环境信息
虚拟机版本:centos7 、HBase版本1.3.3 、 Hadoop版本:2.6.4 、Zookeeper版本:3.4.5
异常信息
ERROR [main] zookeeper.RecoverableZooKeeper: ZooKeeper exists failed after 4 attempts
WARN [main] zookeeper.ZKUtil: hconnection-0x44b294960x0, quorum=hadoop2:2182, baseZNode=/hbase Unable to set watcher on znode (/hbase/hbaseid)
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
异常处理
Hadoop、Zookeeper均启动成功;HBase启动成功后,查看进程都在;启动 hbase shell ,抛出如上异常 再次查看HBase相关进程,消失;说明Hbase启动失败,查看后台日志,发现如下关键信息:
java.net.ConnectException: Connection refused
zookeeper.RecoverableZooKeeper: ZooKeeper create failed after 4 attempts
Caused by: org.apache.hadoop.hbase.ZooKeeperConnectionException: master:160000x0, quorum=hadoop2:2182, baseZNode=/hbase Unexpected KeeperException creating base node
Caused by: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase
说明Hbase没有连接上Zookeeper,我们知道,HBase可以使用内置的Zookeeper,也可以使用外部的Zookeeper,通过在配置文件hbase-env.sh 将 export HBASE_MANAGES_ZK 属性设置为false ,设置为外部的Zookeeper(这个没有问题)
export HBASE_MANAGES_ZK=false
问题出现在这里:
需要将端口写在这里:
修改完成,启动HBase:start-hbase.sh ,启动HBase shell : hbase shell