当前位置:   article > 正文

java连接zookeeper服务器出现“org.apache.zookeeper.KeeperExceptionKeeper:ErrorCode = ConnectionLoss ”_org.apache.zookeeper.keeperexception$sessionexpire

org.apache.zookeeper.keeperexception$sessionexpiredexception: keepererrorcod

错误信息如下:

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)
  • 1
  • 2
  • 3
  • 4
  • 5

原因:连接还没有创建完成,就操作节点就会报异常?

解决办法:连接超时时间要设置的足够大
private static final int sessionTimeout = 30000;
在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/386352
推荐阅读
相关标签
  

闽ICP备14008679号