Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient

13.5k views Asked by At

i just installed hive and mysql.. and copied the mysqlconnector to the hive_home/lib folder

but when i try show databases and create table commands in the hive> prompt giving me the error as below:

create database saty;
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

and my hive_site.xml is

<property>    
  <name>javax.jdo.option.ConnectionURL</name>         
  <value>jdbc:mysql://localhost:3306/hadoop?CreateDatabaseIfNotExist=true</value>         
  <description>JDBC connect string for a JDBC metastore</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionDriverName</name>
  <value>com.mysql.jdbc.Driver</value>
  <description>Driver class name for a JDBC metastore</description>
</property>

<property>
  <name>hive.metastore.warehouse.dir</name>
  <value>/user/hive/warehouse</value>
  <description>location of default database for the warehouse</description>
</property>

and i dont have a directory called /user/hive/warehouse in my file system.

i created these path with mkdir command.. and tried after reboot.. bout still getting the error..

regards, satya

4

There are 4 answers

0
Sreenath Kamath On

Try Specifying these two properties

<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>username</value>
<description>Username to use against metastore database</description>
</property>

<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>password</value>
<description>Password to use against metastore database</description>
</property>

And Similarly the username of your mysql login should have the permission to access the db sepcified in the JDBC connection string. This Can be acheived using the following command

GRANT ALL ON Databasename.* TO username@'%' IDENTIFIED BY 'password';
0
cdhit On

reconfigure your hive using -hiveconf hive.root.logger=warn,console than find the detail reason that why you could not instantiate your hive mate store client.

The problem i met was wrong mysql configuration, the error message is "Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'". When i change binlog_format from "statement" to "binlog_format=mixed", then hive meta store client instantiate successfully.

Hope it work for you.

0
roshan4074 On

The answer is located at http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH5/5.0/CDH5-Installation-Guide/cdh5ig_hive_schema_tool.html

To suppress the schema check and allow the metastore to implicitly modify the schema, you need to set the hive.metastore.schema.verification configuration property to false in hive-site.xml.

0
PHDFanBoy On

I had similar issue and the cause in my case was selinux where it prevented Postgres from proper running.

I inserted following line to the first line of /etc/rc3.d/S64postgresql -

echo 0 > /selinux/enforce # Disable selinux temporarily

and restarted the node with the hive metastore.

So generally you can check two things:

  1. Check whether the DB for the metastore is running properly
  2. Whether the user/passwd from the property is correct