Java Hive 启动 -[ERROR] 终端初始化失败;回到不受支持的状态
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28997441/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Hive startup -[ERROR] Terminal initialization failed; falling back to unsupported
提问by Venkat
I have downloaded hive and modified HADOOP_HOME to
我已经下载了 hive 并将 HADOOP_HOME 修改为
HADOOP_HOME=${bin}/../../usr/local/hadoop
my actual hadoop path is
我的实际 hadoop 路径是
/usr/local/hadoop
in .bashrc i have added the below env variables
在 .bashrc 中,我添加了以下环境变量
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/*:.
then i tried starting hive using bin/hive. I got the below error
然后我尝试使用 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)
采纳答案by Rodrigo Salvo
I had the same problem and got it working from this link:
我遇到了同样的问题,并从这个链接开始工作:
https://cwiki.apache.org/confluence/display/Hive/Hive+on+Spark%3A+Getting+Started
https://cwiki.apache.org/confluence/display/Hive/Hive+on+Spark%3A+Getting+Started
- Hive has upgraded to Jline2 but jline 0.9x exists in the Hadoop lib.
- Hive 已升级到 Jline2,但 Hadoop 库中存在 jline 0.9x。
So you should follow these steps:
所以你应该遵循以下步骤:
- Delete jline from the Hadoop lib directory (it's only pulled in transitively from ZooKeeper).
- export HADOOP_USER_CLASSPATH_FIRST=true
- 从 Hadoop lib 目录中删除 jline(它只是从 ZooKeeper 中传递过来的)。
- 导出 HADOOP_USER_CLASSPATH_FIRST=true
回答by Mund
Try to delete one of this file
尝试删除此文件之一
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:在 [ 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:在 [ jar:file:/usr/lib/hive/apache-hive-1.1.0-bin/lib/hive-jdbc-1.1.0-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.jar 中找到绑定。班级]
then i think it will only choose to bind to one. so multiple binding will not be available anymore
那么我认为它只会选择绑定到一个。所以多重绑定将不再可用
回答by uday sharma
Try after removing the jline-0.9.94.jar file under the path $HADOOP_HOME/share/hadoop/yarn/lib/jline-0.9.94.jar
删除路径$HADOOP_HOME/share/hadoop/yarn/lib/jline-0.9.94.jar下的jline-0.9.94.jar文件后试试
Here's the link to jira ticket https://issues.apache.org/jira/browse/HIVE-8609
这是 jira 票的链接 https://issues.apache.org/jira/browse/HIVE-8609
回答by raja
I had the same problem with cloudera CDH5.4 . Removing jline-0.9.94.jar from yarn/libs folder worked for me.
我在 cloudera CDH5.4 上遇到了同样的问题。从 yarn/libs 文件夹中删除 jline-0.9.94.jar 对我有用。
回答by Qasim
check this link it might help you Facing issue while running hive from CLI
检查此链接它可能会帮助您在从 CLI 运行 hive 时遇到问题
回答by mountrix
With the new version of Hive (1.2.1), I just had to replace jline-2.12.jar with jline-2.13.jar in the installation / lib folder.
使用新版本的 Hive(1.2.1),我只需要将安装 /lib 文件夹中的 jline-2.12.jar 替换为 jline-2.13.jar。
回答by Divas
Do this locate jline
.
这样做locate jline
。
The file, jline-0.9.94.jar, is located in 3 locations, delete it from all the 3 locations and do the necessary export:
文件 jline-0.9.94.jar 位于 3 个位置,从所有 3 个位置将其删除并进行必要的导出:
$ export HADOOP_USER_CLASSPATH_FIRST=true
回答by krish727
I just set the
我只是设置
HADOOP_USER_CLASSPATH_FIRST=true
and it works for me for this issue.
对于这个问题,它对我有用。
回答by Mohammed Asad
With Hadoop version 2.4.1 and Hive 1.2.0. I had the same issue. And after setting HADOOP_USER_CLASSPATH_FIRST=true in .bashrc
使用 Hadoop 版本 2.4.1 和 Hive 1.2.0。我遇到过同样的问题。在 .bashrc 中设置 HADOOP_USER_CLASSPATH_FIRST=true 后
It worked like a charm!!!
它就像一个魅力!
回答by KARTHIKEYAN.A
You should init the hadoop libary:
您应该初始化 hadoop 库:
$ vi ~/.bashrc
$ export HADOOP_USER_CLASSPATH_FIRST=true
$ source .bashrc
$ hive