ZooKeeper Curator UnimplementedException
Thanks for ZooKeeper Version Compatibility
org.apache.zookeeper.KeeperException$UnimplementedException: KeeperErrorCode = Unimplemented for /zk_test_15:34:57.926
Curator 与 ZooKeeper 的版本不兼容,是产生该异常的原因。
- Curator 4.0 has a hard dependency on ZooKeeper 3.5.x
- If you are using ZooKeeper 3.5.x there’s nothing additional to do - just use Curator 4.0
- But ZooKeeper 3.4.x is used - only use Curator 4.0 will cause UnimplementedException
Curator 4.0 supports ZooKeeper 3.4.x ensembles in a soft-compatibility mode.
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
<version>4.0.1</version>
<exclusions>
<exclusion>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>3.4.13</version>
</dependency>
上面的解决方式是将 ZooKeeper 依赖的版本由 3.5.x 降至 3.4.x
自然也可以通过降低 Curator 依赖版本的方式处理该异常:)