解决org.apache.zookeeper.KeeperException$UnimplementedException: KeeperErrorCode = Unimplemented for

忘是亡心i 2022-10-29 07:52 415阅读 0赞

使用curator连接zookeeper后,创建节点时,报如下错误:

  1. org.apache.zookeeper.KeeperException$UnimplementedException: KeeperErrorCode = Unimplemented for /com.xuan.rpc.service.UserService/provider/127.0.0.1:8990
  2. at org.apache.zookeeper.KeeperException.create(KeeperException.java:106)
  3. at org.apache.zookeeper.KeeperException.create(KeeperException.java:54)
  4. at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:1637)
  5. at org.apache.curator.framework.imps.CreateBuilderImpl$17.call(CreateBuilderImpl.java:1180)
  6. at org.apache.curator.framework.imps.CreateBuilderImpl$17.call(CreateBuilderImpl.java:1156)
  7. at org.apache.curator.connection.StandardConnectionHandlingPolicy.callWithRetry(StandardConnectionHandlingPolicy.java:67)
  8. at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:81)
  9. at org.apache.curator.framework.imps.CreateBuilderImpl.pathInForeground(CreateBuilderImpl.java:1153)
  10. at org.apache.curator.framework.imps.CreateBuilderImpl.protectedPathInForeground(CreateBuilderImpl.java:607)
  11. at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:597)
  12. at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:575)
  13. at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:51)
  14. at com.xuan.rpc.registry.impl.ZookeeperRegistryHandler.createEphemeral(ZookeeperRegistryHandler.java:137)
  15. at com.xuan.rpc.registry.impl.ZookeeperRegistryHandler.create(ZookeeperRegistryHandler.java:105)
  16. at com.xuan.rpc.registry.impl.ZookeeperRegistryHandler.registry(ZookeeperRegistryHandler.java:74)
  17. at com.xuan.rpc.server.RpcServer.startServer(RpcServer.java:64)
  18. at com.xuan.rpc.ServerBootstrap.main(ServerBootstrap.java:41)

原因:

  1. 是版本的问题

zookeeper版本:zookeeper-3.4.6
cuartor版本:4.3.0

看Curator官网的声明:
地址:http://curator.apache.org/
The are currently two released versions of Curator, 2.x.x and 3.x.x:

Curator 2.x.x - compatible with both ZooKeeper 3.4.x and ZooKeeper 3.5.x
Curator 3.x.x - compatible only with ZooKeeper 3.5.x and includes support for new features such as dynamic reconfiguration, etc.
版本不匹配的问题,我这里是使用的curator版本过高,使用2.xx就没有问题了。我自己使用的是:2.13.0

发表评论

表情:
评论列表 (有 0 条评论,415人围观)

还没有评论,来说两句吧...

相关阅读