java连接zookeeper服务器出现“org.apache.zookeeper.KeeperExceptionKeeper:ErrorCode = ConnectionLoss ”
错误信息如下:org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /eclipseat org.apache.zookeeper.KeeperException.create(KeeperException.java:99)at org.apa...
·
错误信息如下:
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /eclipse
at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:783)
at com.shm.bigdata.zk.SimpleZkClient.testCreate(SimpleZkClient.java:31)
原因:连接还没有创建完成,就操作节点就会报异常?
解决办法:连接超时时间要设置的足够大
private static final int sessionTimeout = 30000;
更多推荐
已为社区贡献1条内容
所有评论(0)