Pivotal Knowledge Base


How to find the Hive metadata store password


Product Version
Pivotal HD 3.x
Ambari server 1.7.1 / 2.1.x
Hive 0.14.x


While setting up HiveServer2 HA or when fixing permissions in the MYSQL Hive metastore, it may be necessary to know the Hive Metastore MYSQL password. This article describes how to find the password in case the hive metastore password is different than the default password "hive" and the password has been lost.

Procedure 1

  1. Log into the hive server node via SSH as root.
  2. Locate the hive-site.xml file which by default, should be in /etc/hive/conf/hive-site.xml.
  3. Search for the configuration setting: "javax.jdo.option.ConnectionPassword"
  4. The value associated with the configuration setting "javax.jdo.option.ConnectionPassword" is the hive metastore password; in the example below, the password is "hive":
[root@node1 conf]# grep -A1 "Password" /etc/hive/conf/hive-site.xml
[root@node1 conf]# ^C

     5. If the option "javax.jdo.option.ConnectionPassword" is not present in the hive-server.xml, use Procedure 2 listed below.

Procedure 2

If "javax.jdo.option.ConnectionPassword" is not present in the hive-site.xml, use this procedure:

     1. Connect via SSH to the Ambari server.

     2. Connect to the Ambari database.

[root@phd301 ~]# psql -U ambari
Password for user ambari:
psql (8.4.20)
Type "help" for help.

     3. Enable expanded display:

ambari=> \x on
Expanded display is on.

     4. Review the latest hive-server configuration in Ambari (the output may take up multiple lines):

ambari=> select config_id,type_name,config_data from clusterconfig where type_name='hive-site' ORDER BY config_id DESC LIMIT 1;

-[ RECORD 1 ]--config_id | 120 type_name | hive-site config_data | 
"hive.zookeeper.client.port":"2181","hive.compactor.worker.threads":"0","hive.exec.submitviachild":"false"} ambari=>

    5. From the output above, find "javax.jdo.option.ConnectionPassword". Immediately afterwards, the password should be displayed; for example, here "changeme" is the password:





Powered by Zendesk