1

I installed Hadoop 3.2.1 and top of hadoop installed hive on centos7 and getting below errors. How to install hive with mysql?

[root@master hive]# hive
which: no hbase in (/opt/hive/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/spark/bin:/opt/hadoop/bin:/opt/spark/bin:/root/.local/bin:/root/bin:/root/kafka_2.11-2.3.1/bin:/usr/java/jdk1.8.0_141-cloudera/bin:/opt/spark/bin:/opt/hive/bin)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/hive/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.25.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]
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
        at org.apache.hadoop.conf.Configuration.set(Configuration.java:1357)
        at org.apache.hadoop.conf.Configuration.set(Configuration.java:1338)
        at org.apache.hadoop.mapred.JobConf.setJar(JobConf.java:536)
        at org.apache.hadoop.mapred.JobConf.setJarByClass(JobConf.java:554)
        at org.apache.hadoop.mapred.JobConf.<init>(JobConf.java:448)
        at org.apache.hadoop.hive.conf.HiveConf.initialize(HiveConf.java:4042)
        at org.apache.hadoop.hive.conf.HiveConf.<init>(HiveConf.java:4000)
        at org.apache.hadoop.hive.common.LogUtils.initHiveLog4jCommon(LogUtils.java:81)
        at org.apache.hadoop.hive.common.LogUtils.initHiveLog4j(LogUtils.java:65)
        at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:702)
        at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:323)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:236)
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
mr.data_engg
  • 11
  • 1
  • 7
  • Which version of Hive? What are you expecting to happen by running that command? – OneCricketeer Nov 18 '19 at 08:23
  • Right now i am using hive-2.3.6. i also tried with 3.1.x version.. if you suggest any specific version for hadoop 3.2.1 then i will try. i am trying to install on the top of single machine hadoop. if you have installation and configuration steps pls share with me. Thank in advance – mr.data_engg Nov 18 '19 at 08:50
  • 3
    Resolved by using below steps:step 1: Go to the HADOOP_INSTALLATION_DIR/share/hadoop/common/lib and check the guava.jar version step 2: Now go to HIVE_INSTALLATION_DIR/lib and compare the guava file version of hive with hadoop. If they are not same, delete the older version among them and copy the newer version in both. – mr.data_engg Nov 18 '19 at 09:51
  • Feel free to answer your own question below – OneCricketeer Nov 21 '19 at 06:14

2 Answers2

0

I have installed Hadoop 3.2.1 and Hive 2.3.1 on Ubuntu 18.04. I got this exception and after many surfing on the net I found the solution in the following link:

https://issues.apache.org/jira/browse/HIVE-22915

$ rm ~/apache-hive-3.1.2-bin/lib/guava-19.0.jar

$ cp ~/hadoop-3.2.1/share/hadoop/hdfs/lib/guava-27.0-jre.jar  ~/apache-hive-3.1.2-bin/lib/

After you solved that, you will get some errors to run hive shell. To solve these errors, see this video https://www.youtube.com/watch?v=fMT1UTkfI8c on YouTube.

Makyen
  • 31,849
  • 12
  • 86
  • 121
Arash Amani
  • 26
  • 1
  • 4
  • Thank you for your contribution. Please consider summarizing the important steps from external links and videos as they could change or be removed over time. – Michael Heil May 02 '20 at 06:52
0

I have hadoop 3.2.2 and hive 3.1.2 installed

I followed to deal with the error https://issues.apache.org/jira/browse/HIVE-22915 as mentioned in the other reply, but it needed more things to be done.

I followed the steps here for the "wstxparsingexception":
Hive throws: WstxParsingException: Illegal character entity: expansion character (code 0x8)

Some properties in the hive-site.xml file need to be changed as shown in the post below. It sets paths for temp files. If these are not changed you'll like get exception "illegalargumentexception" about using relative paths in absolute.

FAILED: IllegalArgumentException java.net.URISyntaxException: Relative path in absolute URI:

This seemed to solve all the issues

Puneeth Raj
  • 327
  • 2
  • 6