Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Hive Metastore database driver configuration

Solved Go to solution
Highlighted

Hive Metastore database driver configuration

Contributor

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

Accepted Solutions
Highlighted

Re: Hive Metastore database driver configuration

Rising Star

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

Re: Hive Metastore database driver configuration

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...

Highlighted

Re: Hive Metastore database driver configuration

Contributor

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

Highlighted

Re: Hive Metastore database driver configuration

Rising Star

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

Don't have an account?
Coming from Hortonworks? Activate your account here