当前位置:   article > 正文

zookeeper -org.apache.zookeeper.KeeperException$UnimplementedException: KeeperErrorCode = Unimplem_keepererrorcode = unimplemented for flink

keepererrorcode = unimplemented for flink

 

在项目中使用到Apache Curator Framework连接Zookeeper 3.4.9服务器,使用的Curator Framework版本是最新版3.2.1

  1. <dependency>
  2. <groupId>org.apache.curator</groupId>
  3. <artifactId>curator-framework</artifactId>
  4. <version>3.2.1</version>
  5. </dependency>

项目同时导入了zookeeper-3.5.1的库

结果在使用CuratorFramework.create()方法创建新的节点时,抛出了

  1. org.apache.zookeeper.KeeperException$UnimplementedException:
  2. KeeperErrorCode = Unimplemented for [zk节点路径名]

的异常。

Curator Framework的2.x.x版本和3.x.x版本对Zookeeper支持的版本是有差异的,查看Curator Framework的官网(http://curator.apache.org),在Versions部分有这么一段话

  1. Versions
  2. The are currently two released versions of Curator, 2.x.x and 3.x.x:
  3. Curator 2.x.x - compatible with both ZooKeeper 3.4.x and ZooKeeper 3.5.x
  4. Curator 3.x.x - compatible only with ZooKeeper 3.5.x and includes support for new features such as dynamic reconfiguration, etc.

对于zookeeper 3.4.x服务器版本,只有Curator 2.x.x才支持,我使用的是Curator 3.2.1版本,不支持Zookeeper 3.4.9服务器,所以会抛出这个异常, 将Curator Framework的版本改为2.x.x的最后一个版本2.11.1,再运行程序就没有异常了。

  1. <dependency>
  2. <groupId>org.apache.curator</groupId>
  3. <artifactId>curator-framework</artifactId>
  4. <version>2.11.1</version>
  5. </dependency>

大家在直接使用Curator Framework进行Zk监控,或者使用Spring Cloud Zookeeper Config时(内含Curator Framework的引用),请注意连接的zookeeper服务器版本,根据zk服务器版本的不同,选择不同的Curator Framework版本

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

闽ICP备14008679号