1、解决 QuorumCnxManager$Listener@7631Exception while listening java.net.BindException:\tH)*()tht(Bind failed)
查看/logs下的日志文件:
ERROR (/xxxxxxx:3888:QuorumCnxManager$Listener@7631Exception while listening
java.net.BindException:\tH)*()tht(Bind failed)
解决方法:在三个zoo.cfg中加入
quorumListenOnAllIPs=true
2、解决 ConnectionLossException: KeeperErrorCode = ConnectionLoss for /xxx
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /xxx
我的zoo.cfg文件:
解决方法:
1、检查三台服务器的2181、2888、3888端口阿里/腾讯云安全组是否配置入站负责。
2、检查三台服务器的2181、2888、3888端口是否开放防火墙,或直接关闭防火墙。
3、tickTime:通信心跳时间,Zookeeper服务器与客户端心跳时间,单位毫秒。
极大可能是客户端的问题,即超时时间配置的太短(默认是2000,我改成10000就没问题了)。