Support Questions

Find answers, ask questions, and share your expertise
Announcements
Welcome to the upgraded Community! Read this blog to see What’s New!

how to change password for ambari db post install

avatar
Explorer

I have a cluster deployed via ambari and would like to change the password that is used to talk to db (psql). I also have encryption on for ambari db and ldap password (http://docs.hortonworks.com/HDPDocuments/Ambari-2.2.0.0/bk_Ambari_Security_Guide/content/_optional_encrypt_database_and_ldap_passwords.html).

1 ACCEPTED SOLUTION

avatar
$ grep "password" /etc/ambari-server/conf/ambari.properties
server.jdbc.user.passwd=/etc/ambari-server/conf/password.dat

$ echo "bigdata_custom" > /etc/ambari-server/conf/password.dat

$ sudo -u postgres psql
postgres=# ALTER USER ambari WITH PASSWORD 'bigdata_custom';
postgres=# \q

$ ambari-server restart

View solution in original post

16 REPLIES 16

avatar

avatar
Explorer

@Neeraj Sabharwal i think that is reseting the password for admin user. I want to change the password for the db.

avatar

@arpit The password that you used during the ambari-server setup..correct?

avatar

@arpit Try this

avatar
Explorer

i dont have the file /etc/ambari-server/conf/password.dat. In ambari properties i see

server.jdbc.user.passwd=${alias=ambari.db.password}

But i cant find ambari.db.password in the properties file. I have encryption enabled for passwords.

avatar

avatar
Explorer

@Neeraj Sabharwal are you suggesting i decrypt, change password and then encrypt again?

avatar

@arpit yes as per the doc...If it's production then need support on this.

avatar
Explorer

Its an internal production cluster. I will try to follow the steps and see how it goes.

avatar

@arpit How did you handle the encryption?

avatar
Explorer

i un encrypted it and changed the password based on what @Alejandro Fernandez had and then encrypted it again.

avatar

@arpit The doc that I shared had a note on encryption...Just curious if you had chance to try that ..Link

Taking notes to make sure that we have a best answer to close the thread.

avatar
Explorer

@Neeraj that doc talks about changing master key for encryption. I had to change the password for DB. So i un encrypted. Changed password and encrypted it.

avatar
$ grep "password" /etc/ambari-server/conf/ambari.properties
server.jdbc.user.passwd=/etc/ambari-server/conf/password.dat

$ echo "bigdata_custom" > /etc/ambari-server/conf/password.dat

$ sudo -u postgres psql
postgres=# ALTER USER ambari WITH PASSWORD 'bigdata_custom';
postgres=# \q

$ ambari-server restart

avatar
Mentor

My ambari.properties has the following entries !

[root@amuru]# grep "password" /etc/ambari-server/conf/ambari.properties

server.jdbc.rca.user.passwd=/etc/ambari-server/conf/password.dat

server.jdbc.user.passwd=/etc/ambari-server/conf/password.dat

All have the same password so enlighten me does the echo cascade the change ?

avatar
Explorer

Thanks @Neeraj Sabharwal and @Alejandro Fernandez i used information from both answers and updated the password.

Labels