执行hbase zkcli后报错信息如下:
15/10/02 15:17:55 INFO zookeeper.ZooKeeper: Client environment:java.library.path=/opt/cloudera/parcels/CDH-5.4.5-1.cdh5.4.5.p0.7/lib/hadoop/lib/native
15/10/02 15:17:55 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp
15/10/02 15:17:55 INFO zookeeper.ZooKeeper: Client environment:java.compiler=<NA>
15/10/02 15:17:55 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux
15/10/02 15:17:55 INFO zookeeper.ZooKeeper: Client environment:os.arch=amd64
15/10/02 15:17:55 INFO zookeeper.ZooKeeper: Client environment:os.version=3.16.0-4-amd64
15/10/02 15:17:55 INFO zookeeper.ZooKeeper: Client environment:user.name=root
15/10/02 15:17:55 INFO zookeeper.ZooKeeper: Client environment:user.home=/root
15/10/02 15:17:55 INFO zookeeper.ZooKeeper: Client environment:user.dir=/root
15/10/02 15:17:55 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=l11-n6.gnx.lable.nl:2181,l12-n6.gnx.lable.nl:2181,l10-n6.gnx.lable.nl:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@57aabb39
Welcome to ZooKeeper!
15/10/02 15:17:55 INFO zookeeper.ClientCnxn: Opening socket connection to server l10-n6.gnx.lable.nl/10.255.10.6:2181. Will not attempt to authenticate using SASL (unknown error)
JLine support is enabled
15/10/02 15:17:55 INFO zookeeper.ClientCnxn: Socket connection established, initiating session, client: /10.255.14.4:35889, server: l10-n6.gnx.lable.nl/10.255.10.6:2181
[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 jline.console.ConsoleReader.<init>(ConsoleReader.java:227)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:219)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:207)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.apache.zookeeper.ZooKeeperMain.run(ZooKeeperMain.java:311)
at org.apache.zookeeper.ZooKeeperMain.main(ZooKeeperMain.java:282)
at org.apache.hadoop.hbase.zookeeper.ZooKeeperMainServer.main(ZooKeeperMainServer.java:136)
JLine support is disabled
15/10/02 15:17:55 INFO zookeeper.ClientCnxn: Session establishment complete on server l10-n6.gnx.lable.nl/10.255.10.6:2181, sessionid = 0x34fffc20a1b3a56, negotiated timeout = 30000
WATCHER::
WatchedEvent state:SyncConnected type:None path:null
--------------------------------------------------------------------------------------
解决办法:
vim bin/hbase文件,添加信息如下红色字体部分:
elif [ "$COMMAND" = "zkcli" ] ; then
CLASS="org.apache.hadoop.hbase.zookeeper.ZooKeeperMainServer"
CLASSPATH=`echo $CLASSPATH | sed 's/jruby-cloudera-1.0.0.jar//g'`
之后重启hbase伪分布环境,之后再次进入zk的客户端不报错了,正常进入:
官方的jire:
https://issues.apache.org/jira/browse/ZOOKEEPER-1718
CDH版本的issus:
https://issues.cloudera.org/browse/DISTRO-758
---------------------
作者:浅汐王
来源:CSDN
原文:https://blog.csdn.net/qq_32252917/article/details/78389638
版权声明:本文为博主原创文章,转载请附上博文链接!