Reply
Highlighted
New Contributor
Posts: 3
Registered: ‎05-13-2016
Accepted Solution

How to configure apache Sentry using cloudera manager api in python?

Hello,

I'm using cm_api in python to install cloudera cdh5.7. I have an apiException while configuring sentry server.
All parameters for sentry database like "sentry_server_database_port" or "sentry_server_database_password" are unknown.

Somebody can tell me how to solve the problem?

Do i need a particular cm_api version?

Thanks!

Cloudera Employee
Posts: 182
Registered: ‎07-08-2013

Re: How to configure apache Sentry using cloudera manager api in python?

You don't need a particular version, only need to update the Sentry configuration example

 

 

from cm_api.api_client import ApiResource
api = ApiResource("cm-server-host")
cluster = api.get_cluster("_CLUSTER_NAME_")
service = cluster.create_service("sentry","SENTRY")
# Service-Wide
# sentry_server_database_host: Assuming embedded DB is running from where embedded-db is located.
service_config = {"sentry_server_database_host": "sentry-db.host.here",
"sentry_server_database_user": "sentry",
"sentry_server_database_name": "sentry",
"sentry_server_database_password": "cloudera",
"sentry_server_database_port": "7432",
"sentry_server_database_type": "postgresql"}
service.update_config(service_config)
# eg: fetch all hosts>hostId
# print [host.hostId for host in api.get_all_hosts()]
host = [host for host in api.get_all_hosts()][0]
service.create_role("sentry", "SENTRY_SERVER", host.hostId) Ref: https://github.com/gdgt/cmapi

 

 

 

 

 

New Contributor
Posts: 3
Registered: ‎05-13-2016

Re: How to configure apache Sentry using cloudera manager api in python?

Thanks

 

I used an external postgresql databases. Everything worked fine!

New Contributor
Posts: 1
Registered: ‎07-17-2017

Re: How to configure apache Sentry using cloudera manager api in python?

[ Edited ]

Is there any step by step guide

Announcements