Unable to instantiate HiveMetaStoreClient

40,583

Solution 1

Does {username} have the permissions to create /var/lib/hive/metastore/metastore_db ?

If it is a test cluster you could do

sudo chmod -R 777 /var/lib/hive/metastore/metastore_db

or chown it to the user running it.

Solution 2

this is for permissions issue for hive folder. please de the following will work well. go to hive user ,for me hduser, sudo chmod -R 777 hive

Solution 3

Try removing the $HADOOP_HOME/build folder. I had same problem with hive-0.10.0 or above versions. Then I tried hive-0.9.0 and got a different set of errors. Luckily found this thread Hive doesn't work on install. Tried the same trick and it worked for me magically. I am using default derby db.

Solution 4

This issue occur due to abrupt termination of hive shell. Which created a unattended db.lck file. TO resolve this issue,

browse to your metastore_db location
remove the tmp, dbex.lck and db.lck files. Open the hive shell again. It will work.

You can see tmp, dbex.lck and db.lck files get created once again.

Share:
40,583
Ashish Sharma
Author by

Ashish Sharma

Updated on July 05, 2022

Comments

  • Ashish Sharma
    Ashish Sharma almost 2 years

    I have a 3 nodes cluster running hive. When i try to run some test from outside the cluster i am getting following given below error

    FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask Logging initialized using configuration in file:/net/slc01nwj/scratch/ashsshar/view_storage/ashsshar_bda_latest_2/work/hive_scratch/conf/hive-log4j.properties

    When I login to cluster node and execute hive its working fine.

    hive> show databases ; OK default

    Following error is genereted in test log files

    13/04/04 03:10:49 ERROR security.UserGroupInformation: PriviledgedActionException as:ashsshar {my username }(auth:SIMPLE) cause:java.io.IOException: javax.jdo.JDOFatalDataStoreException: Failed to create database '/var/lib/hive/metastore/metastore_db', see the next exception for details. NestedThrowables: java.sql.SQLException: Failed to create database '/var/lib/hive/metastore/metastore_db', see the next exception for details.

    My hive-site.xml file contains this connection property ::

    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:derby:;databaseName=/var/lib/hive/metastore/metastore_db;create=true</value>
    <description>JDBC connect string for a JDBC metastore</description>
    

    I have changed the /var/lib/hive/metastore/metastore_db at my cluster node, but still getting the same error

    I have also tried removing all *lck files from above directory