Created 01-23-2017 09:09 PM
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.'
Created 01-23-2017 09:44 PM
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
Created 01-23-2017 09:39 PM
Try point to the library provided by the system package as described in the docs?
Created 01-23-2017 10:00 PM
I did, but it looks like the jar is not being automatically copeied on restart of Hive to other nodes
Created 01-23-2017 09:44 PM
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