Unable to instantiate HiveMetaStoreClient

Ashish Sharma picture Ashish Sharma · Apr 4, 2013 · Viewed 40.3k times · Source

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

Answer

Romain picture Romain · Apr 5, 2013

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.