22/07/08 ERROR zookeeper.RecoverableZooKeeper: ZooKeeper exists failed after 4 attempts 22/07/08 WARN zookeeper.ZKUtil: hconnection-0x6a0e5d320x0, quorum=lylg102:2181,lylg103:2181,lylg104:2181, baseZNode=/hbase Unable to set watcher on znode (/hbase/hbaseid) org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
经过查找,这是因为客户端通过zookeeper连接到hbase时连接过多的问题
解决方案- 设置hbase-site.xml配置文件,添加如下属性
hbase.zookeeper.property.maxClientCnxns 300 Property from ZooKeeper's config zoo.cfg. Limit on number of concurrent connections (at the socket level) that a single client, identified by IP address, may make to a single member of the ZooKeeper ensemble. Set high to avoid zk connection issues running standalone and pseudo-distributed.
将最大连接数我这设置成了300,
- 修改zoo.cfg配置文件
添加:maxClientCnxns=300 - 优化自己写的程序逻辑,减少连接次数
重启下zookeeper,hbase,重新测试,问题解决。
参考:https://blog.csdn.net/wangshuminjava/article/details/84581723



