Created on 08-25-2017 06:25 AM - edited 09-16-2022 05:08 AM
Hi,
I have a cluster created with Cloudera Director. Every database, including the Hue DB is external, and I think all the credentials were generated by Director. Now I'd like to add users using the Hue shell or some other script, but it asks for the Hue secrets, that are set in the Manager, but they are secured.
- How can I check these generated users/passwords for the databases?
- If I have the password, what's the easiest way to add Hue users programatically?
Created 08-28-2017 08:06 AM
Hello ztoth,
If you have the administrator credentials of Cloudera Manager, you can use it to request the SQL credentials of the Hue service. For example, the below REST API call returns the password in the configuration variable named "database_password" for any Hue service:
https://cloudera.github.io/cm_api/apidocs/v17/path__clusters_-clusterName-_services_-serviceName-_co...
Unfortunately, the Hue API does not have a programmatical way to add regular users, but you can use external authentication backends such as LDAP.
Created 08-31-2017 02:27 AM
Hi Zsolt,
thanks for the answer! I could find the Hue DB creds in the API, but for some reason I'm still unable to connect to the database. I'm trying to connect with the following command, with the configs returned by the API:
mysql -h <database_host> -u <database_user> -p <database_name>
and giving the <database_password> when prompted. Also tried without specifying the <database_name>, but no luck, getting Access Denied every time. Is there something I miss?
Created 08-31-2017 07:37 AM
Hi,
Hue is connecting directly to the mysql server that this configuration provides. Which machine do you use to login mysql? Is it the same node where Hue is installed?