Community Articles
Find and share helpful community-sourced technical articles
Labels (1)
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!
1,860 Views
0 Kudos
Don't have an account?
Version history
Last update:
‎01-03-2018 07:22 PM
Updated by:
Contributors
Top Kudoed Authors