Plain Vanilla Hadoop series by ITVersity - Issue in Hive setup

Hi all,

I’ve been trying to setup a single node cluster following a youtube video series by ITVersity and stuck up with the issue of setting up Hive metastore. Below the link for the video (Go to 14:20)

While issuing hive command it somehow worked in the video and even Mr.Durga was wondering how it worked. But I’m getting the below exception. Please help me with this as I’m struck here and I wanted to learn hadoop by setting it up in my laptop.

[root@centosdemo ~]# hive
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/software/apache-hive-2.1.1-bin/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/software/hadoop-2.7.1/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]

Logging initialized using configuration in jar:file:/software/apache-hive-2.1.1-bin/lib/hive-common-2.1.1.jar!/hive-log4j2.properties Async: true
Exception in thread “main” java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:591)
at org.apache.hadoop.hive.ql.session.SessionState.beginStart(SessionState.java:531)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:705)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:641)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)

Is it failing when you are trying to launch Hive? Probably your mysql database might be down.

You can check by running service mysqld status

Hi,
Thanks for the reply. Yes it is failing when I’m trying to launch hive. Below are the validations I performed before launching hive.

  1. Added HIVE_HOME to PATH variable in bash_profile and executed the bash_profile.

  2. Updated hive-site.xml in the conf folder where i installed hive. Below is the screenshot of my hive-site.xml file.

  3. Kept the mysql connector jar file in the lib directory where i installed hive

  4. Validated whether hadoop daemons are running, java is running, mysql service is running. Everything working fine.

Launched hive and I’m getting this error.

Also, I tried to start the metastore service manually. Even that is throwing same kind of error.

Please help me with this. I’m struck with the installation :worried:

Below is my bash_profile file for your reference.

Hey, I found the solution !! :grinning::grin:

cd $HIVE_HOME/scripts/metastore/upgrade/mysql/
< login to mysql >
mysql> use metastore;
mysql> source hive-schema-<your_version>.mysql.sql;

restart hive metastore and it will work.
Note: All the steps mentioned in above comments are to be done before trying this.

1 Like