我已经下载了hive并将hadoop\u修改为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启动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)
11条答案
按热度按时间6uxekuva1#
我也遇到了同样的问题,并从以下链接得到了解决:
https://cwiki.apache.org/confluence/display/hive/hive+on+spark%3a+getting+started
配置单元已升级到jline2,但hadoop库中存在jline0.9x。
所以你应该遵循以下步骤:
从hadoop lib目录中删除jline(它只从zookeeper中以传递方式拉入)。
export hadoop\u user\u classpath\u first=true
m4pnthwp2#
对于新版本的hive(1.2.1),我只需要在installation/lib文件夹中将jline-2.12.jar替换为jline-2.13.jar。
iswrvxsc3#
hadoop版本2.4.1和hive 1.2.0。我也有同样的问题。在.bashrc中设置hadoop\u user\u classpath\u first=true之后
它像一个魅力!!!
xxe27gdn4#
做这个
locate jline
.文件jline-0.9.94.jar位于3个位置,请将其从所有3个位置删除,然后执行必要的导出:
wgmfuz8q5#
您应该初始化hadoop库:
ss2ws0br6#
删除路径$hadoop\u home/share/hadoop/yarn/lib/jline-0.9.94.jar下的jline-0.9.94.jar文件后再试
这是jira机票的链接https://issues.apache.org/jira/browse/hive-8609
yrdbyhpb7#
我只是设定了
在这个问题上对我很有效。
6yoyoihd8#
检查此链接可能会帮助您在从cli运行配置单元时遇到问题
egdjgwm89#
尝试删除此文件之一
slf4j:在中找到绑定[jar:file:/usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar/org/slf4j/impl/staticloggerbinder.class]
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]
那么我想它只会选择绑定到一个。所以多重绑定将不再可用
a7qyws3x10#
我改名了
addJava "-Djline.terminal=jline.UnixTerminal"
至addJava "-Djline.terminal=jline2.UnixTerminal"
在“activator”文件中q35jwt9p11#
cloudera cdh5.4也有同样的问题。从yarn/libs文件夹中删除jline-0.9.94.jar对我很有用。