ishpreet ishpreet -3 years ago 425
MySQL Question

Unable to instantiate metadata.SessionHiveMetaStoreClient in Hive(Ubuntu 16.04)

I am trying to setup hive 2.3.0 with mysql on Ubuntu 16.04. I have installed Hadoop and it's running fine. I am able to enter hive console, however no commands are being executed instead it gives me an error:

SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

Here's my hive-site.xml

<description>metadata is stored in a MySQL server</description>
<description>MySQL JDBC driver class</description>
<description>user name for connecting to mysql server</description>
<description>password for connecting to mysql server</description>

I have also created metastore database in mysql using this link.

Error Image

Answer Source

I figured the solution. The issue that Metastore wasn't instantiate is due to duplicated keys in mysql. Instead of Sourcing the the hive schema from mysql. Use this:hive --service metastore

Also to view the complete stack trace use schematool: schematool -initSchema -dbType mysql --verbose

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download