Hive环境搭建启动报错

hive-site.xml文件内容:

 1 xml version="1.0" encoding="UTF-8" standalone="no"?>
 2 xml-stylesheet type="text/xsl" href="configuration.xsl"?><configuration>
18   
19   
20   
21   
22   
23     <property>
24         <name>hive.metastore.warehouse.dirname>
25         <value>/user/hive/warehousevalue>
26     property>
27   
28     <property>
29         <name>javax.jdo.option.ConnectionURLname>
30         <value>jdbc:mysql://walloce.one:3306/hive?createDatabaseIfNotExist=truevalue>
31     property>
32     
33     <property>
34         <name>javax.jdo.option.ConnectionDriverNamename>
35         <value>com.mysql.jdbc.Drivervalue>
36     property>
37     
38     <property>
39         <name>javax.jdo.option.ConnectionUserNamename>
40         <value>rootvalue>
41     property>
42     
43     <property>
44         <name>javax.jdo.option.ConnectionPasswordname>
45         <value>123456value>
46     property>
47 configuration>

 

hive-env.sh环境配置文件:

1 # Set HADOOP_HOME to point to a specific hadoop install directory
2 HADOOP_HOME=/opt/module/hadoop-2.5.0
3 
4 # Hive Configuration Directory can be controlled by:
5 export HIVE_CONF_DIR=/opt/module/hive-1.2.1/conf

 

报错日志内容:

 1 Logging initialized using configuration in file:/opt/module/hive-1.2.1/conf/hive-log4j.properties
 2 [ERROR] Terminal initialization failed; falling back to unsupported
 3 java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected
 4         at jline.TerminalFactory.create(TerminalFactory.java:101)
 5         at jline.TerminalFactory.get(TerminalFactory.java:158)
 6         at jline.console.ConsoleReader.(ConsoleReader.java:229)
 7         at jline.console.ConsoleReader.(ConsoleReader.java:221)
 8         at jline.console.ConsoleReader.(ConsoleReader.java:209)
 9         at org.apache.hadoop.hive.cli.CliDriver.setupConsoleReader(CliDriver.java:787)
10         at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:721)
11         at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:681)
12         at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:621)
13         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
15         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16         at java.lang.reflect.Method.invoke(Method.java:606)
17         at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
18 
19 Exception in thread "main" java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected
20         at jline.console.ConsoleReader.(ConsoleReader.java:230)
21         at jline.console.ConsoleReader.(ConsoleReader.java:221)
22         at jline.console.ConsoleReader.(ConsoleReader.java:209)
23         at org.apache.hadoop.hive.cli.CliDriver.setupConsoleReader(CliDriver.java:787)
24         at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:721)
25         at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:681)
26         at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:621)
27         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
28         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
29         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
30         at java.lang.reflect.Method.invoke(Method.java:606)
31         at org.apache.hadoop.util.RunJar.main(RunJar.java:212)

 

由日志可以看出是类:

jline.Terminal出问题了!!
其次hadoop下面的 org.apache.hadoop.hive.cli.CliDriver 这个类也出问题了,因为hive是运行在hdfs上的,所以初步判断是jar包冲突了。
所以要检查hadoop下与之对应的jar包和hive的jar包是否一致,不一致要替换成Hive的jar包,
Hadoop中jline的jar包路径:/opt/module/hadoop-2.5.0/share/hadoop/yarn/lib

 Hive环境搭建启动报错_第1张图片

Hive中的jline的jar:

Hive环境搭建启动报错_第2张图片

 

可以看出版本是不一致的,接下来要替换吊hadoop下的jar包,并重启hdfs。

 

成功启动,没问题!!!

 
   

2018-11-22

 

转载于:https://www.cnblogs.com/yin1361866686/p/10003482.html

你可能感兴趣的:(大数据,java,数据库)