今天初学zookeeper遇到了下列错误:
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /zhiHu(连接丢失)
- 出错原因:设置的会话时间(sessionTimeout)太小了!!!
解决办法:
private int sessionTimeout = 2000000;
还有可能是因为没关防火墙,需要查看以下防火墙状态
systemctl status firewalld //查看防火墙状态
systemctl stop firewalld //关闭防火墙