FusionInsight HD 未使用集群zookeeper jar包导致应用连接zookeeper报错

发布时间:  2017-05-18 浏览次数:  192 下载次数:  0
问题描述

hbase代码报错连接ZK异常,报错如下


WARNING: hconnection-0x2f943d71-0x12000465e2790001, quorum=192.168.1.215:24002,192.168.1.227:24002,192.168.1.219:24002, baseZNode=/hbase Unable to set watcher on znode (/hbase/hbaseid)
org.apache.zookeeper.KeeperException$AuthFailedException: KeeperErrorCode = AuthFailed for /hbase/hbaseid
at org.apache.zookeeper.KeeperException.create(KeeperException.java:123)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1045)
at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:222)
at org.apache.hadoop.hbase.zookeeper.ZKUtil.checkExists(ZKUtil.java:481)
at org.apache.hadoop.hbase.zookeeper.ZKClusterId.readClusterIdZNode(ZKClusterId.java:65)
at org.apache.hadoop.hbase.client.ZooKeeperRegistry.getClusterId(ZooKeeperRegistry.java:83)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.retrieveClusterId(HConnectionManager.java:909)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.<init>(HConnectionManager.java:703)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:459)
at org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:438)
at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:319)
at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:194)
at com.yload.engine.hbase.HBaseOperation.connectKerberosHbase(HBaseOperation.java:243)
at com.yload.boot.StartYloadEngine.main(StartYloadEngine.java:219)
处理过程
参考维护宝典排查了如下几个点,报错依旧。
1 user.keytab路径写错。
2 user.principal写错。
3 集群做过切换域名操作但客户端拼接url时使用旧的principal。
4 有防火墙相关设置

收集客户端完整打印,发现并没有FourLetterWordMain 关键字的打印,如果zookeeper的jar包是FusionInsight下载客户端的,会有如下打印

2017-03-09 17:08:12,215 | INFO  | main-SendThread(189-39-116-195:24002) | connecting to 189-39-116-195 24002 | org.apache.zookeeper.client.FourLetterWordMain.send4LetterWord(FourLetterWordMain.java:118)
根因

没有使用从集群下载客户端中的jar包导致连接zookeeper异常。

解决方案

通过FI集群下载客户端,将zookeeper jar包替换之后连接zookeeper正常。

建议与总结

开发环境一定要按照文档来部署安装。

END