I have configured my Hive as given on link: http://www.youtube.com/watch?v=Dqo1ahdBK_A, but I am getting the following error while creating a table in Hive. I am using hadoop-1.2.1 and hive-0.12.0.
hive> create table employee(emp_id int,name string,salary double);
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
this could due to more than one "metastore_db". Remove "metastore_db", restart hadoop cluster and open hive shell from $HIVE_HOME/bin folder
The answer is located in 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.
This could be an issue with the metastore like sachinjose described or a connection issue. Run hive console in debug mode like so:
hive -hiveconf hive.root.logger=DEBUG,console
Then execute a simple query like
show tables;
and see what happens. I ran into this issue after restarting a namenode and it was due to the wrong host being set in the configuration files (ec2 generates new private IP/hostname when restarted).To resolve this issue start the hadoop services first.
Then I run
It works fine for me.
I was facing the same issue there are some important point's that could be resolve this problem.
1.Put the following at the beginning of hive-site.xml
this is set relative path in absolute URI and configuring Metastore where the database is stored
2.Remove
$HIVE_HOME/metastore_db
But Be aware, this will remove your schema completely!3.Now,You must Initialize Derby database.By default, Hive uses Derby database
also I suppose that your environment variable has been set correctly ,if not please check them that are looking like below:
and then run
hive
command and typeshow databases;
Looks like problem with your metastore. If you are using the default hive metastore embedded derby. Lock file would be there in case of abnormal exit. if you remove that lock file this issue would be solved