- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to configure apache Sentry using cloudera manager api in python?
- Labels:
-
Apache Sentry
-
Cloudera Manager
Created on ‎05-15-2016 11:50 PM - edited ‎09-16-2022 03:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
Created ‎05-16-2016 02:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Created ‎05-16-2016 02:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Created ‎05-16-2016 07:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks
I used an external postgresql databases. Everything worked fine!
Created on ‎07-17-2017 08:42 AM - edited ‎07-17-2017 08:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there any step by step guide
Created ‎05-20-2019 09:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
