Bug in the hive

When I am connected to ireport then if I say show tables in hive shell, this error will be as follows:

Metadata error: 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

+3


source to share


6 answers


Have you copied the jar containing the JDBC driver for your db metadata to the Hive lib directory?

For example, if you are using MySQL to store db metadata data, you need to copy



mysql-connector-java-5.1.22-bin.jar

in . $HIVE_HOME/lib

This fixed this error for me.

+7


source


One possibility is that your chaos isn't working. I ran into this issue while doing a simple hadoop node cluster on my local. Each time you start your computer, you must manually start your chaos nodes before the hive can connect to them.

Try to run $ HADOOP_HOME / bin / stop-all.sh

If the output says that there were no nodes, then it means that your chaos was not in this case, run

$ HADOOP_HOME / bin / start-all.sh

and then the hive and you should be good to go.



(this used the default derby database. Apparently if you are using mysql you can also get this error from some connector config (see other answer)).

EDIT: Actually, another thing I discovered is that Hive has to create a metastore_db directory whenever you start the hive, but it creates it in the path from which the hive was launched. You may face the above error if you do not have write permission on the directory you are working from. To fix this, you can set the config in hive-site.xml to make this directory absolute, not relative.

See here:

metastore_db is created wherever I run Hive

+2


source


The bug reports on Hive are great. When I added creds to conf / hive-site.xml, I didn't notice the pre-existing username and password elements, so when I added my own they weren't used and I got the same non-overlapping message as above.

If you run the metatool command it will keep track of the stack and you get this, which in my case indicates the real reason. Hope this helps someone else:

mfellows@matt.mit /usr/local/hive-0.11.0-bin $ bin/metatool -listFSRoot
Initializing HiveMetaTool..
13/06/05 21:44:43 INFO metastore.ObjectStore: ObjectStore, initialize called
13/06/05 21:44:43 ERROR DataNucleus.Plugin: Bundle "org.eclipse.jdt.core" requires "org.eclipse.core.resources" but it cannot be resolved.
13/06/05 21:44:43 ERROR DataNucleus.Plugin: Bundle "org.eclipse.jdt.core" requires "org.eclipse.core.runtime" but it cannot be resolved.
13/06/05 21:44:43 ERROR DataNucleus.Plugin: Bundle "org.eclipse.jdt.core" requires "org.eclipse.text" but it cannot be resolved.
13/06/05 21:44:43 INFO DataNucleus.Persistence: Property datanucleus.cache.level2 unknown - will be ignored
13/06/05 21:44:43 INFO DataNucleus.Persistence: Property javax.jdo.option.NonTransactionalRead unknown - will be ignored
13/06/05 21:44:43 INFO DataNucleus.Persistence: ================= Persistence Configuration ===============
13/06/05 21:44:43 INFO DataNucleus.Persistence: DataNucleus Persistence Factory - Vendor: "DataNucleus"  Version: "2.0.3"
13/06/05 21:44:43 INFO DataNucleus.Persistence: DataNucleus Persistence Factory initialised for datastore     URL="jdbc:mysql://localhost/hive_metastore" driver="com.mysql.jdbc.Driver" userName="APP"
13/06/05 21:44:43 INFO DataNucleus.Persistence: ===========================================================
13/06/05 21:44:44 ERROR Datastore.Schema: Failed initialising database.
Access denied for user 'APP'@'localhost' (using password: YES)
org.datanucleus.exceptions.NucleusDataStoreException: Access denied for user 'APP'@'localhost' (using password: YES)
  at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getConnection(ConnectionFactoryImpl.java:536)

      

+2


source


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

In general, this means that the Hive Metastor service does not start as expected . But the error message you are inserting does not contain enough information to determine the exact cause of the problem.
Indeed, there are many reasons that can lead to this error, as the answers posted by other authors are about a specific aspect.
My suggestion: run the command hive --service metastore

to get a more detailed and targeted error message and then fix the problem accordingly. You can also refer to the log file / tmp / user_name / hive.log.

+2


source


I was told that generally we get this exception if the hive console does not end properly. Correction:

Run jps command, find "RunJar" process and kill it using kill -9 command

+1


source


Thanks for the answer above regarding the JDBC driver. I am using Oracle for Hive Metastore, so:

$ cp $ ORACLE_HOME / jdbc / lib / ojdbc6.jar $ HIVE_HOME / lib / ojdbc6.jar

+1


source







All Articles