解决org.apache.zookeeper.KeeperException$UnimplementedException: KeeperErrorCode = Unimplemented for
使用curator连接zookeeper后,创建节点时,报如下错误:
org.apache.zookeeper.KeeperException$UnimplementedException: KeeperErrorCode = Unimplemented for /com.xuan.rpc.service.UserService/provider/127.0.0.1:8990
at org.apache.zookeeper.KeeperException.create(KeeperException.java:106)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:54)
at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:1637)
at org.apache.curator.framework.imps.CreateBuilderImpl$17.call(CreateBuilderImpl.java:1180)
at org.apache.curator.framework.imps.CreateBuilderImpl$17.call(CreateBuilderImpl.java:1156)
at org.apache.curator.connection.StandardConnectionHandlingPolicy.callWithRetry(StandardConnectionHandlingPolicy.java:67)
at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:81)
at org.apache.curator.framework.imps.CreateBuilderImpl.pathInForeground(CreateBuilderImpl.java:1153)
at org.apache.curator.framework.imps.CreateBuilderImpl.protectedPathInForeground(CreateBuilderImpl.java:607)
at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:597)
at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:575)
at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:51)
at com.xuan.rpc.registry.impl.ZookeeperRegistryHandler.createEphemeral(ZookeeperRegistryHandler.java:137)
at com.xuan.rpc.registry.impl.ZookeeperRegistryHandler.create(ZookeeperRegistryHandler.java:105)
at com.xuan.rpc.registry.impl.ZookeeperRegistryHandler.registry(ZookeeperRegistryHandler.java:74)
at com.xuan.rpc.server.RpcServer.startServer(RpcServer.java:64)
at com.xuan.rpc.ServerBootstrap.main(ServerBootstrap.java:41)
原因:
是版本的问题
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
还没有评论,来说两句吧...