Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Hive Metastore database driver configuration

avatar
Rising Star

I am setting the Hive metastore db driver using:

ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/hdp/current/hive-server2/lib/mysql-connector-java-5.1.38.jar
Using python  /usr/bin/python
Setup ambari-server
.Copying /usr/hdp/current/hive-server2/lib/mysql-connector-java-5.1.38.jar to /var/lib/ambari-server/resources
If you are updating existing jdbc driver jar for mysql with mysql-connector-java-5.1.38.jar. Please remove the old driver jar, from all hosts. Restarting services that need the driver, will automatically copy the new jar to the hosts.
JDBC driver was successfully initialized.
Ambari Server 'setup' completed successfully.

and I have checked that the jar is in that path. But, when I try to restart Hiveserver2, I get the following error message:

2017-01-23 20:59:37,414 - Error! Sorry, but we can't find jdbc driver with default name mysql-connector-java.jar in hive lib dir. So, db connection check can fail. Please run 'ambari-server setup --jdbc-db={db_name} --jdbc-driver={path_to_jdbc} on server host.'
1 ACCEPTED SOLUTION

avatar
Expert Contributor

Confirm that mysql-connector-java.jar is in the Java share directory.

ls /usr/share/java/mysql-connector-java.jar

#under /usr/hdp/current/hive-server2/lib/

run the commands

cp mysql-connector-java-5.1.38.jar mysql-connector-java.jar

ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/hdp/current/hive-server2/lib/mysql-connector-java.jar

#then restart all services oh Hive

View solution in original post

3 REPLIES 3

avatar

Try point to the library provided by the system package as described in the docs?

https://docs.hortonworks.com/HDPDocuments/Ambari-2.4.2.0/bk_ambari-reference/content/using_hive_with...

avatar
Rising Star

I did, but it looks like the jar is not being automatically copeied on restart of Hive to other nodes

avatar
Expert Contributor

Confirm that mysql-connector-java.jar is in the Java share directory.

ls /usr/share/java/mysql-connector-java.jar

#under /usr/hdp/current/hive-server2/lib/

run the commands

cp mysql-connector-java-5.1.38.jar mysql-connector-java.jar

ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/hdp/current/hive-server2/lib/mysql-connector-java.jar

#then restart all services oh Hive