我已经下载了hive并将HADOOP_HOME修改为
HADOOP_HOME=${bin}/../../usr/local/hadoop
我的实际hadoop路径是
/usr/local/hadoop
<。>在.bashrc中我添加了以下env变量
export HIVE_HOME=/usr/lib/hive/apache-hive-1.1.0-bin
export PATH=$PATH:$HIVE_HOME/bin
export CLASSPATH=$CLASSPATH:/usr/local/Hadoop/lib/*:.
export CLASSPATH=$CLASSPATH:/usr/local/hive/lib/*:.
然后我尝试使用bin / hive启动配置单元。我收到了以下错误
Logging initialized using configuration in jar:file:/usr/lib/hive/apache-hive-1.1.0-bin/lib/hive-common-1.1.0.jar!/hive-log4j.properties
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/lib/hive/apache-hive-1.1.0-bin/lib/hive-jdbc-1.1.0-standalone.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]
[ERROR] Terminal initialization failed; falling back to unsupported
java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected
at jline.TerminalFactory.create(TerminalFactory.java:101)
at jline.TerminalFactory.get(TerminalFactory.java:158)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:229)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:221)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:209)
at org.apache.hadoop.hive.cli.CliDriver.getConsoleReader(CliDriver.java:773)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:715)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:675)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:615)
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)
Exception in thread "main" java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected
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.hadoop.hive.cli.CliDriver.getConsoleReader(CliDriver.java:773)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:715)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:675)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:615)
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)
答案 0 :(得分:64)
我遇到了同样的问题,并从这个链接开始工作:
https://cwiki.apache.org/confluence/display/Hive/Hive+on+Spark%3A+Getting+Started
所以你应该按照以下步骤操作:
答案 1 :(得分:8)
在$ HADOOP_HOME / share / hadoop / yarn / lib / jline-0.9.94.jar
路径下删除jline-0.9.94.jar文件后尝试这是jira票证的链接 https://issues.apache.org/jira/browse/HIVE-8609
答案 2 :(得分:5)
我刚设置了
HADOOP_USER_CLASSPATH_FIRST=true
对于这个问题它适用于我。
答案 3 :(得分:4)
尝试删除此文件之一
SLF4J:在[ jar:file:/usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/ org / slf4j / impl / StaticLoggerBinder中找到绑定。类强>
SLF4J:在[ jar:file:/usr/lib/hive/apache-hive-1.1.0-bin/lib/hive-jdbc-1.1.0-standalone.jar!/ org /中找到绑定SLF4J / IMPL / StaticLoggerBinder.class 强>
然后我认为它只会选择绑定一个。所以不再有多重绑定
答案 4 :(得分:1)
我遇到了与cloudera CDH5.4相同的问题。从yarn / libs文件夹中删除jline-0.9.94.jar对我有用。
答案 5 :(得分:1)
执行此操作locate jline
。
文件jline-0.9.94.jar位于3个位置,从所有3个位置删除它并进行必要的导出:
$ export HADOOP_USER_CLASSPATH_FIRST=true
答案 6 :(得分:1)
使用Hadoop版本2.4.1和Hive 1.2.0。我遇到过同样的问题。在.bashrc中设置HADOOP_USER_CLASSPATH_FIRST = true之后
它就像一个魅力!!!
答案 7 :(得分:0)
点击此链接可能会对您有所帮助src
答案 8 :(得分:0)
你应该初始化hadoop libary:
$ vi ~/.bashrc
$ export HADOOP_USER_CLASSPATH_FIRST=true
$ source .bashrc
$ hive
答案 9 :(得分:0)
我重命名了
addJava "-Djline.terminal=jline.UnixTerminal"
到
addJava "-Djline.terminal=jline2.UnixTerminal"
在&#34;激活器&#34;文件