CDH5之Found class jline.Terminal, but interface was expected

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
云数据库 RDS PostgreSQL,集群系列 2核4GB
简介: 一.背景:        公司CDH5集群已经部署完毕,需要通过web界面添加hive组件,一般来说通过web界面来添加,会报两个错误, 一个是配置hive的元数据的/usr/share/java/mysql-connector-java.
一.背景:
       公司CDH5集群已经部署完毕,需要通过web界面添加hive组件,一般来说通过web界面来添加,会报两个错误,
一个是配置hive的元数据的/usr/share/java/mysql-connector-java.jar驱动包,
还有一个错误就是如图:

二.错误明细:

++ exec /opt/cloudera/parcels/CDH/lib/hadoop/bin/hadoop jar /opt/cloudera/parcels/CDH/lib/hive/lib/hive-cli-1.1.0-cdh5.4.8.jar org.apache.hive.beeline.HiveSchemaTool -verbose -dbType mysql -initSchema
[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:159)
at org.apache.hive.beeline.BeeLineOpts.(BeeLineOpts.java:74)
at org.apache.hive.beeline.BeeLine.(BeeLine.java:119)
at org.apache.hive.beeline.HiveSchemaTool.runBeeLine(HiveSchemaTool.java:346)
at org.apache.hive.beeline.HiveSchemaTool.runBeeLine(HiveSchemaTool.java:326)
at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:266)
at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:243)
at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:473)
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)

三.错误分析:
1. ++ exec /opt/cloudera/parcels/CDH/lib/hadoop/bin/hadoop jar /opt/cloudera/parcels/CDH/lib/hive/lib/hive-cli-1.1.0-cdh5.4.8.jar org.apache.hive.beeline.HiveSchemaTool -verbose -dbType mysql -initSchema
这句是配置hive组件的元数据库是mysql,在初始化hive的schema,也就是存储元数据的表呀等等,所以这句对于我们没有用

2.[ERROR] Terminal initialization failed; falling back to unsupported
这句说初始化schema失败,回退到不支持,这句也没有给出很明显的错误,所以看第三句
3.java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected
第三句说明发现类jline.Terminal,但是接口是过期的。初步怀疑是jline的jar版本太低。

四.解决方案:
hadoop-hdfs目录下存在老版本jline,将hive下的新版本jline的JAR包拷贝到hadoop-hdfs下
    1.进入hive/lib目录查看jline版本和文件的所在位置
[root@alish1-xxx-01 ~]# cd /opt/cloudera/parcels/CDH-5.4.8-1.cdh5.4.8.p0.4/lib/hive/lib
[root@alish1-xxx-01 lib]# ll jline*
lrwxrwxrwx 1 root root 28 Apr  9 17:05 jline-2.12.jar -> ../../../jars/jline-2.12.jar

    2.进入CDH集群的jar包文件夹,查看jline包,一看有四个版本,最新的是2.12
[root@alish1-xxx-01 lib]# cd ../../../jars/
[root@alish1-xxx-01 jars]# ll jline*
-rwxr-xr-x 1 root root  87249 Oct 16 01:36 jline-0.9.94.jar
-rw-r--r-- 1 root root 164623 Oct 16 01:36 jline-2.10.4.jar
-rw-r--r-- 1 root root 206202 Oct 16 01:33 jline-2.11.jar
-rw-r--r-- 1 root root 213854 Oct 16 01:32 jline-2.12.jar

    3.find一下jline包哪些组件会有
[root@alish1-xxx-01 ~]# find / -name jline*
/opt/cloudera/parcels/CDH/lib/crunch/lib/jline-2.10.4.jar
/opt/cloudera/parcels/CDH/lib/llama/lib/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/flume-ng/lib/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/lib/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/libtools/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/oozie-sharelib-mr1/lib/pig/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/oozie-sharelib-mr1/lib/hive/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/oozie-sharelib-mr1/lib/hive2/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/oozie-sharelib-mr1/lib/sqoop/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/oozie-sharelib-mr1/lib/hcatalog/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/libserver/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/oozie-sharelib-yarn/lib/pig/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/oozie-sharelib-yarn/lib/hive/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/oozie-sharelib-yarn/lib/hive2/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/oozie-sharelib-yarn/lib/sqoop/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/oozie-sharelib-yarn/lib/hcatalog/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/hadoop-0.20-mapreduce/lib/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/impala/lib/jline-2.12.jar
/opt/cloudera/parcels/CDH/lib/sentry/lib/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/hive/lib/jline-2.12.jar
/opt/cloudera/parcels/CDH/lib/hadoop-httpfs/webapps/webhdfs/WEB-INF/lib/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/whirr/lib/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/hadoop-hdfs/lib/jline-0.9.94.jar
/opt/cloudera/parcels/CDH/lib/sqoop2/client-lib/jline-0.9.94.jar
/opt/cloudera/parcels/CDH/lib/hadoop-kms/webapps/kms/WEB-INF/lib/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/zookeeper/lib/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/hadoop-yarn/lib/jline-2.11.jar
/opt/cloudera/parcels/CDH/jars/jline-2.12.jar
/opt/cloudera/parcels/CDH/jars/jline-2.11.jar
/opt/cloudera/parcels/CDH/jars/jline-2.10.4.jar
/opt/cloudera/parcels/CDH/jars/jline-0.9.94.jar

###通过观察发现,/opt/cloudera/parcels/CDH/lib/hadoop-hdfs/lib/jline-0.9.94.jar,这个路径的jar版本过低,才0.9.94版本,所以要替换为最新的版本2.12
(hive组件的最终创建表的数据还是会存在hdfs文件系统上.肯定就是替换一下就行);
###而sqoop2组件我没有安装,所以不需要替换!

    4.cp 最新jline包
[root@alish1-xxx-01 ~]# cp /opt/cloudera/parcels/CDH/jars/jline-2.12.jar /opt/cloudera/parcels/CDH/lib/hadoop-hdfs/lib/
[root@alish1-xxx-01 ~]# cp /opt/cloudera/parcels/CDH/lib/hadoop-hdfs/lib/jline-0.9.94.jar /opt/cloudera/parcels/CDH/lib/hadoop-hdfs/lib/jline-0.9.94.jar.bak
[root@alish1-xxx-01 ~]#

五.验证结果:
单击web安装界面的"重试"按钮,it's ok!!!











相关实践学习
如何快速连接云数据库RDS MySQL
本场景介绍如何通过阿里云数据管理服务DMS快速连接云数据库RDS MySQL,然后进行数据表的CRUD操作。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
7月前
|
Python
【Error】DeprecationWarning: executable_path has been deprecated, please pass in a Service object
【Error】DeprecationWarning: executable_path has been deprecated, please pass in a Service object
117 2
|
Ubuntu Unix Linux
成功解决ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the
成功解决ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the
成功解决ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the
|
Linux
configure: error: cannot guess build type; you must specify one
configure: error: cannot guess build type; you must specify one
454 0
|
8月前
|
Linux
报错 Package ‘oniguruma‘, required by ‘virtual:world‘, not found
报错 Package ‘oniguruma‘, required by ‘virtual:world‘, not found
461 0
checking build system type... ./config.guess: unable to guess system type/you must specify one
checking build system type... ./config.guess: unable to guess system type/you must specify one
174 0
Perhaps you should add the directory containing libpcre.pc to the PKG_CONFIG_PATH
Perhaps you should add the directory containing libpcre.pc to the PKG_CONFIG_PATH
170 0
警告解决办法:class xxxx has virtual method but non-virtual destructor
警告解决办法:class xxxx has virtual method but non-virtual destructor
150 0
Unknown run configuration type AndroidRunConfigurationType的解决办法
Unknown run configuration type AndroidRunConfigurationType的解决办法
116 0
|
Shell Python
安装 AWS Command Line Interface 失败 Could not find a version that satisfies the requirement awscli
版权声明:本文为 testcs_dn(微wx笑) 原创文章,非商用自由转载-保持署名-注明出处,谢谢。 https://blog.csdn.net/testcs_dn/article/details/79739281 ...
2018 0
|
分布式计算 资源调度 Java
[ERROR] Terminal initialization failed; falling back to unsupported java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface
1:出现此种错误应该是jar版本包冲突了,启动hive的时候,由于hive依赖hadoop,启动hive,会将hadoop的配置以及jar包等等导入到hive中,导致jar包版本冲突,下面贴一下错误,然后贴一下解决方法: 1 [root@master bin]# .
1612 0

热门文章

最新文章