Hive startup -[ERROR] Terminal initialization fail

2020-05-18 17:08发布

I have downloaded hive and modified HADOOP_HOME to

HADOOP_HOME=${bin}/../../usr/local/hadoop

my actual hadoop path is

/usr/local/hadoop

in .bashrc i have added the below env variables

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

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)

标签: java hadoop hive
11条回答
贪生不怕死
2楼-- · 2020-05-18 17:08

I had the same problem with cloudera CDH5.4 . Removing jline-0.9.94.jar from yarn/libs folder worked for me.

查看更多
Root(大扎)
3楼-- · 2020-05-18 17:14

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.

查看更多
老娘就宠你
4楼-- · 2020-05-18 17:14

You should init the hadoop libary:

$ vi ~/.bashrc
$ export HADOOP_USER_CLASSPATH_FIRST=true
$ source .bashrc
$ hive
查看更多
Emotional °昔
5楼-- · 2020-05-18 17:15

Do this 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:

$ export HADOOP_USER_CLASSPATH_FIRST=true
查看更多
祖国的老花朵
6楼-- · 2020-05-18 17:15

check this link it might help you Facing issue while running hive from CLI

查看更多
男人必须洒脱
7楼-- · 2020-05-18 17:18

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

  • Hive has upgraded to Jline2 but jline 0.9x exists in the Hadoop lib.

So you should follow these steps:

  1. Delete jline from the Hadoop lib directory (it's only pulled in transitively from ZooKeeper).
  2. export HADOOP_USER_CLASSPATH_FIRST=true
查看更多
登录 后发表回答