Community Articles

Find and share helpful community-sourced technical articles.
Labels (1)
avatar
Expert Contributor
Hive metastore DB Connection verification from Command line:-

You can run the following on any node where ambari agent installed on the cluster,

You need the following information to run this test.

You can use this to validate if the password stored in ambari and the actual mysql db password are same.

1. mysql db hostname
2. mysql db port number
3. mysql database name which hive metastore uses
4. mysql username
5. mysql password

Syntax:-

java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar -Djava.library.path=/usr/lib/ambari-agent org.apache.ambari.server.DBConnectionVerification "jdbc:mysql://<mysql db hostname>:<mysql db port number>/<mysql database name>" "<mysql username>" "<mysql password>" com.mysql.jdbc.Driver


Example:-

/usr/jdk64/jdk1.8.0_112/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar -Djava.library.path=/usr/lib/ambari-agent org.apache.ambari.server.DBConnectionVerification "jdbc:mysql://test.openstacklocal:50001/hive" hive hive com.mysql.jdbc.Driver

Connected to DB Successfully!
3,804 Views
0 Kudos