0

I have been trying to install hive on windows. I have 64 bit windows 8 on which HADOOP and SPARK are running. I have

1.HADOOP_HOME
2.HIVE_HOME
3.SPARK_HOME
4.Platform
5.PATH

all these variables set up on my system. Also, I was getting these error before

Missing Hive Execution Jar: C:\hadoop1\hadoop-2.7.2\apache-hive-1.2.1-bin/lib/hive-exec-*.jar

I solved these error by editing the Hive file inside bin folder of HIVE. These errors are because of the forward slash"/" in environment variables in HIVE file. I replace them with "\" and those errors are gone. But now I am facing another problem. I am getting these error

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/spark/spark-1.6.1-bin-hadoop2.6/lib/spark-assembly-1.6.1-hadoop2.6.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/hadoop2.7/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.slf4j.impl.Log4jLoggerFactory]
Beeline version 1.6.1 by Apache Hive
Exception in thread "main" java.lang.NoSuchMethodError: org.fusesource.jansi.internal.Kernel32.GetConsoleOutputCP()I
    at jline.WindowsTerminal.getConsoleOutputCodepage(WindowsTerminal.java:293)
    at jline.WindowsTerminal.getOutputEncoding(WindowsTerminal.java:186)
    at jline.console.ConsoleReader.<init>(ConsoleReader.java:230)
    at jline.console.ConsoleReader.<init>(ConsoleReader.java:221)
    at jline.console.ConsoleReader.<init>(ConsoleReader.java:209)
    at org.apache.hive.beeline.BeeLine.getConsoleReader(BeeLine.java:834)
    at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:770)
    at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:484)
    at org.apache.hive.beeline.BeeLine.main(BeeLine.java:467)
    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)

I have searched alot on these. Also I have posted these question on HIVE User mailing List but got no response. Please help me with this.

Rebecca
  • 159
  • 1
  • 4
  • 13
  • That error usually means that the source was compiled against a version of a library that contained the method but is deployed with a different version that does not contain the method, or where the method has a different signature. Make sure the libraries installed in your deployment environment match the required versions. – Jim Garrison May 23 '16 at 20:02
  • Hi @JimGarrison, thanks for replying I have read the installation guide and according to that I have JAVA 1.7, HADOOP 2.7 and Apache hive 1.2.1 but I still got this error? – Rebecca May 23 '16 at 20:25
  • Hive/Hadoop are outside my areas of expertise. I'm just telling you what typically causes that type of error -- a dependency version problem. – Jim Garrison May 23 '16 at 20:28

1 Answers1

0

Here are the steps I executed to solve this:

  1. Install the Microsoft Visual C++ 2008 Redistribuable add-on (not the latest, not the SP1...)
  2. Download the jline-2.12.jar (from any maven repository site) and put it into your %SPARK_HOME%\lib directory
  3. I assume you already have a hadoop client correctly configured with HADOOP_HOME, HADOOP_CONF_DIR y YARN_CONF_DIR defined. You need SPARK_HOME to be defined, too
  4. In case you're using a Cloudera 5.5+ cluster, download the Cloudera JDBC Driver for Hive (last version available) and unzip the Cloudera_Hive41* archive into %HADOOP_HOME$\share\hadoop\hive (this directory doesn't exist, you need to create it). If you're not using Cloudera, you can forget this point.
  5. Create a new beeline batch script :
@echo off
setLocal EnableDelayedExpansion

Rem Hive Classpath Settings ONLY IF YOU'RE USING CLOUDERA
set HIVE_CLOUDERA_DRIVER_DIR=%HADOOP_HOME%\share\hadoop\hive
set HIVE_CLASSPATH=
for /R %HIVE_CLOUDERA_DRIVER_DIR% %%a in (*.jar) do (
  set HIVE_CLASSPATH=!HIVE_CLASSPATH!;%%a
)
set HIVE_CLASSPATH=!HIVE_CLASSPATH!
Rem IF YOU'RE NOT USING CLOUDERA YOU CAN SKIP THE HIVE_CLASSPATH_STUFF

Rem Spark Classpath Settings
set SPARK_CLASSPATH=
for /R %SPARK_HOME%/lib %%a in (*.jar) do (
  set SPARK_CLASSPATH=!SPARK_CLASSPATH!;%%a
)
set SPARK_CLASSPATH=!SPARK_CLASSPATH!

Rem Hadoop classpath
set HADOOP_CLASSPATH=%HADOOP_CONF_DIR%\;%YARN_CONF_DIR%\\

Rem Java Virtual Machine Options
set JAVA_OPTIONS=-Xms1g -Xmx1g 

Rem Execute Beeline
java -cp "%HIVE_CLASSPATH%;%SPARK_CLASSPATH%;%HADOOP_CLASSPATH%" %JAVA_OPTIONS% org.apache.hive.beeline.BeeLine %*

You can execute beeline throw this new script without any issue.

Cheloute
  • 783
  • 2
  • 11
  • 27