这是一个验证贴,因为社区文档是错误的。

先说结论

Flink1.15仅支持ZooKeeper3.5/3.6,不再支持3.4。FLINK-25146 Drop support for Zookeeper 3.4

社区文档

其中的ZooKeeper Versions描述默认使用3.4,可以自行调整为3.5。从文档上来看自1.11版本就添加了这段描述,到目前最新稳定版本(1.16.0)依然是这么描述的。但是实际我们在flink-1.15.0/lib目录中只看到了flink-shaded-zookeeper-3.5.9.jar,在opt目录中看到了flink-shaded-zookeeper-3.6.3.jar,即默认使用3.5版本,并在opt目录中放置了3.6版本。

其实在1.15的 ReleaseNote 中明确写了,不再支持3.4,只是还是有点不死心,做了如下的验证。

Release notes - Flink 1.15

Drop support for Zookeeper 3.4 #

FLINK-25146 #

Support for using Zookeeper 3.4 for HA has been dropped. Users relying on Zookeeper need to upgrade to 3.5/3.6. By default Flink now uses a Zookeeper 3.5 client.

验证一

那么我们是否可以将3.4的版本(flink-1.13.3/lib/flink-shaded-zookeeper-3.4.14.jar)放置到flink-1.15.3/lib目录中,在1.15版本中使用3.4版本呢?

不能

如果我们这么做,将会遇到 java.lang.ClassNotFoundException: org.apache.flink.shaded.curator5.org.apache.curator.framework.api.ACLProvider ,完整堆栈如下:

 1 2022-12-08 18:18:05,693 INFO  org.apache.flink.runtime.rpc.akka.AkkaRpcService             [] - Stopping Akka RPC service.
2 2022-12-08 18:18:05,734 INFO akka.remote.RemoteActorRefProvider$RemotingTerminator [] - Shutting down remote daemon.
3 2022-12-08 18:18:05,736 INFO akka.remote.RemoteActorRefProvider$RemotingTerminator [] - Remote daemon shut down; proceeding with flushing remote transports.
4 2022-12-08 18:18:05,758 INFO akka.remote.RemoteActorRefProvider$RemotingTerminator [] - Remoting shut down.
5 2022-12-08 18:18:05,782 INFO org.apache.flink.runtime.rpc.akka.AkkaRpcService [] - Stopped Akka RPC service.
6 2022-12-08 18:18:05,782 ERROR org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - Could not start cluster entrypoint YarnApplicationClusterEntryPoint.
7 org.apache.flink.runtime.entrypoint.ClusterEntrypointException: Failed to initialize the cluster entrypoint YarnApplicationClusterEntryPoint.
8 at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.startCluster(ClusterEntrypoint.java:250) ~[flink-dist-1.15.3.jar:1.15.3]
9 at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.runClusterEntrypoint(ClusterEntrypoint.java:711) [flink-dist-1.15.3.jar:1.15.3]
10 at org.apache.flink.yarn.entrypoint.YarnApplicationClusterEntryPoint.main(YarnApplicationClusterEntryPoint.java:112) [flink-dist-1.15.3.jar:1.15.3]
11 Caused by: java.lang.NoClassDefFoundError: org/apache/flink/shaded/curator5/org/apache/curator/framework/api/ACLProvider
12 at org.apache.flink.runtime.highavailability.HighAvailabilityServicesUtils.createZooKeeperHaServices(HighAvailabilityServicesUtils.java:90) ~[flink-dist-1.15.3.jar:1.15.3]
13 at org.apache.flink.runtime.highavailability.HighAvailabilityServicesUtils.createHighAvailabilityServices(HighAvailabilityServicesUtils.java:140) ~[flink-dist-1.15.3.jar:1.15.3]
14 at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.createHaServices(ClusterEntrypoint.java:427) ~[flink-dist-1.15.3.jar:1.15.3]
15 at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.initializeServices(ClusterEntrypoint.java:376) ~[flink-dist-1.15.3.jar:1.15.3]
16 at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.runCluster(ClusterEntrypoint.java:277) ~[flink-dist-1.15.3.jar:1.15.3]
17 at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.lambda$startCluster$1(ClusterEntrypoint.java:227) ~[flink-dist-1.15.3.jar:1.15.3]
18 at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_202]
19 at javax.security.auth.Subject.doAs(Subject.java:422) ~[?:1.8.0_202]
20 at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1875) ~[hadoop-common-3.0.0-cdh6.3.2.jar:?]
21 at org.apache.flink.runtime.security.contexts.HadoopSecurityContext.runSecured(HadoopSecurityContext.java:41) ~[flink-dist-1.15.3.jar:1.15.3]
22 at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.startCluster(ClusterEntrypoint.java:224) ~[flink-dist-1.15.3.jar:1.15.3]
23 ... 2 more
24 Caused by: java.lang.ClassNotFoundException: org.apache.flink.shaded.curator5.org.apache.curator.framework.api.ACLProvider
25 at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_202]
26 at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_202]
27 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[?:1.8.0_202]
28 at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_202]
29 at org.apache.flink.runtime.highavailability.HighAvailabilityServicesUtils.createZooKeeperHaServices(HighAvailabilityServicesUtils.java:90) ~[flink-dist-1.15.3.jar:1.15.3]
30 at org.apache.flink.runtime.highavailability.HighAvailabilityServicesUtils.createHighAvailabilityServices(HighAvailabilityServicesUtils.java:140) ~[flink-dist-1.15.3.jar:1.15.3]
31 at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.createHaServices(ClusterEntrypoint.java:427) ~[flink-dist-1.15.3.jar:1.15.3]
32 at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.initializeServices(ClusterEntrypoint.java:376) ~[flink-dist-1.15.3.jar:1.15.3]
33 at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.runCluster(ClusterEntrypoint.java:277) ~[flink-dist-1.15.3.jar:1.15.3]
34 at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.lambda$startCluster$1(ClusterEntrypoint.java:227) ~[flink-dist-1.15.3.jar:1.15.3]
35 at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_202]
36 at javax.security.auth.Subject.doAs(Subject.java:422) ~[?:1.8.0_202]
37 at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1875) ~[hadoop-common-3.0.0-cdh6.3.2.jar:?]
38 at org.apache.flink.runtime.security.contexts.HadoopSecurityContext.runSecured(HadoopSecurityContext.java:41) ~[flink-dist-1.15.3.jar:1.15.3]
39 at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.startCluster(ClusterEntrypoint.java:224) ~[flink-dist-1.15.3.jar:1.15.3]
40 ... 2 more

验证二

如果使用3.5的客户端访问3.4版本服务端,将会提示 org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.KeeperException$UnimplementedException: KeeperErrorCode = Unimplemented for 异常,完整堆栈如下:

 1 2022-12-08 15:10:14,935 ERROR org.apache.flink.runtime.entrypoint.ClusterEntrypoint        [] - Fatal error occurred in the cluster entrypoint.
2 org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.KeeperException$UnimplementedException: KeeperErrorCode = Unimplemented for /flink/jm_ha_metadata/application_1666841155139_0173
3 at org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.KeeperException.create(KeeperException.java:106) ~[flink-shaded-zookeeper-3-3.5.9-15.0.jar:3.5.9-15.0]
4 at org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.KeeperException.create(KeeperException.java:54) ~[flink-shaded-zookeeper-3-3.5.9-15.0.jar:3.5.9-15.0]
5 at org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:1538) ~[flink-shaded-zookeeper-3-3.5.9-15.0.jar:3.5.9-15.0]
6 at org.apache.flink.shaded.curator5.org.apache.curator.utils.ZKPaths.mkdirs(ZKPaths.java:351) ~[flink-shaded-zookeeper-3-3.5.9-15.0.jar:3.5.9-15.0]
7 at org.apache.flink.shaded.curator5.org.apache.curator.framework.imps.NamespaceImpl$1.call(NamespaceImpl.java:90) ~[flink-shaded-zookeeper-3-3.5.9-15.0.jar:3.5.9-15.0]
8 at org.apache.flink.shaded.curator5.org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:93) ~[flink-shaded-zookeeper-3-3.5.9-15.0.jar:3.5.9-15.0]
9 at org.apache.flink.shaded.curator5.org.apache.curator.framework.imps.NamespaceImpl.fixForNamespace(NamespaceImpl.java:83) ~[flink-shaded-zookeeper-3-3.5.9-15.0.jar:3.5.9-15.0]
10 at org.apache.flink.shaded.curator5.org.apache.curator.framework.imps.NamespaceImpl.newNamespaceAwareEnsurePath(NamespaceImpl.java:109) ~[flink-shaded-zookeeper-3-3.5.9-15.0.jar:3.5.9-15.0]
11 at org.apache.flink.shaded.curator5.org.apache.curator.framework.imps.CuratorFrameworkImpl.newNamespaceAwareEnsurePath(CuratorFrameworkImpl.java:618) ~[flink-shaded-zookeeper-3-3.5.9-15.0.jar:3.5.9-15.0]
12 at org.apache.flink.runtime.util.ZooKeeperUtils.useNamespaceAndEnsurePath(ZooKeeperUtils.java:729) ~[flink-runtime-1.15.2.jar:1.15.2]
13 at org.apache.flink.runtime.highavailability.zookeeper.ZooKeeperMultipleComponentLeaderElectionHaServices.<init>(ZooKeeperMultipleComponentLeaderElectionHaServices.java:85) ~[flink-runtime-1.15.2.jar:1.15.2]
14 at org.apache.flink.runtime.highavailability.HighAvailabilityServicesUtils.createZooKeeperHaServices(HighAvailabilityServicesUtils.java:96) ~[flink-runtime-1.15.2.jar:1.15.2]
15 at org.apache.flink.runtime.highavailability.HighAvailabilityServicesUtils.createHighAvailabilityServices(HighAvailabilityServicesUtils.java:140) ~[flink-runtime-1.15.2.jar:1.15.2]
16 at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.createHaServices(ClusterEntrypoint.java:427) ~[flink-runtime-1.15.2.jar:1.15.2]
17 at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.initializeServices(ClusterEntrypoint.java:376) ~[flink-runtime-1.15.2.jar:1.15.2]
18 at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.runCluster(ClusterEntrypoint.java:277) ~[flink-runtime-1.15.2.jar:1.15.2]
19 at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.lambda$startCluster$1(ClusterEntrypoint.java:227) ~[flink-runtime-1.15.2.jar:1.15.2]
20 at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_202]
21 at javax.security.auth.Subject.doAs(Subject.java:422) [?:1.8.0_202]
22 at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1875) [hadoop-common-3.0.0-cdh6.3.2.jar:?]
23 at org.apache.flink.runtime.security.contexts.HadoopSecurityContext.runSecured(HadoopSecurityContext.java:41) [flink-runtime-1.15.2.jar:1.15.2]
24 at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.startCluster(ClusterEntrypoint.java:224) [flink-runtime-1.15.2.jar:1.15.2]
25 at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.runClusterEntrypoint(ClusterEntrypoint.java:711) [flink-runtime-1.15.2.jar:1.15.2]
26 at org.apache.flink.yarn.entrypoint.YarnApplicationClusterEntryPoint.main(YarnApplicationClusterEntryPoint.java:112) [flink-dist-1.15.3.jar:1.15.3]
27 2022-12-08 15:10:14,943 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - Shutting YarnApplicationClusterEntryPoint down with application status UNKNOWN. Diagnostics Cluster entrypoint has been closed externally..

参考资料:

  1. FLINK-25146Drop support for Zookeeper 3.4
  2. ZooKeeper Version 3.4.x Compatibility

  3. https://nightlies.apache.org/flink/flink-docs-release-1.16/release-notes/flink-1.15/

Flink1.15仅支持ZooKeeper3.5/3.6的更多相关文章

  1. tomcat 6 不支持jsf2.2,仅支持jsf2.0及以下版本

    tomcat 6 不支持jsf2.2,仅支持jsf2.0及以下版本 安装tomcat8即可.

  2. 无法将类型“System.Nullable`1”强制转换为类型“System.Object”。LINQ to Entities 仅支持强制转换 EDM 基元或枚举类型。

    在一个项目中使用LINQ和EF时出现了题目所示的异常,搜索了很多资料都找不到解决办法,主要是因为EF方面的知识欠缺. 先将情况记录如下,以供以后参考. 查询主要设计两张表,由外键关联: 在进行下面的查 ...

  3. Entity FreamWork 无法创建“System.Object”类型的常量值。此上下文仅支持基元类型或枚举类型错误解决

    Entity FreamWork 无法创建“System.Object”类型的常量值.此上下文仅支持基元类型或枚举类型错误解决: 最近在开发中把我原来抄的架构里面的主键由固定的Guid改成了可以泛型指 ...

  4. WCF调试异常信息:ServiceHost 仅支持类服务类型

    "/CommonHelpServices"应用程序中的server错误. ServiceHost 仅支持类服务类型. 说明: 运行当前 Web 请求期间,出现未经处理的异常. 请检 ...

  5. DNS同时占用UDP和TCP端口53——传输数据超过512时候用tcp,DNS服务器可以配置仅支持UDP查询包

    DNS同时占用UDP和TCP端口53是公认的,这种单个应用协议同时使用两种传输协议的情况在TCP/IP栈也算是个另类.但很少有人知道DNS分别在什么情况下使用这两种协议. 先简单介绍下TCP与UDP. ...

  6. IDHTTP-HTTPS通讯方法(Indy10.2.3之前仅支持OpenSSL的0.9.8以前的版本)

    加载https的站点页面内容的时候记得在窗体上加上“IdSSLIOHandlerSocketOpenSSL1” 以及idhttp里面IOHandler为“IdSSLIOHandlerSocketOpe ...

  7. 导入数据任务(id:373985)异常, 错误信息:解析导入文件错误,请检查导入文件内容,仅支持导入json格式数据及excel文件

    小程序导入,别人导出的数据库json文件,错误信息如下: 导入数据库失败, Error: Poll error, 导入数据任务(id:373985)异常,错误信息:解析导入文件错误,请检查导入文件内容 ...

  8. nRF52832 串口仅支持偶检验

    通常在使用串口时,我们习惯是不进行奇偶检验(even/odd parity),让应用层的软件自己检验即可.如果非要硬件校验时,以下是关于NRF52832的奇偶检验配置: // 52832 仅支持 ev ...

  9. 无法创建“System.Object”类型的常量值。此上下文仅支持基元类型或枚举类型

    Entity FreamWork 无法创建“System.Object”类型的常量值.此上下文仅支持基元类型或枚举类型错误解决: 最近在开发中把我原来抄的架构里面的主键由固定的Guid改成了可以泛型指 ...

  10. java8+tomcate8仅支持TLSv1.2

    1.编辑$tomcat_home/conf/server.xml <Connector protocol="org.apache.coyote.http11.Http11NioProt ...

随机推荐

  1. 图机器学习(GML)&图神经网络(GNN)原理和代码实现(前置学习系列二)

    项目链接:https://aistudio.baidu.com/aistudio/projectdetail/4990947?contributionType=1 欢迎fork欢迎三连!文章篇幅有限, ...

  2. 微信小程序的学习(二)

    一.数据绑定 1.数据绑定的基本原则 在 data 中定义数据 在 wxml 中使用数据 2.如何在 data 里面定义数据? 在页面对应的 .js 文件中,把数据定义到 data 对象中即可: 3. ...

  3. 【Java并发001】使用级别:线程相关知识

    一.前言 本文介绍Java线程相关知识(不包括线程同步+线程通信,这个内容在笔者的另一篇博客中介绍过了),包括:线程生命周期.线程优先级.线程礼让.后台线程.联合线程. 二.线程生命周期 2.1 引子 ...

  4. 【Spring系列】- Spring事务底层原理

    Spring事务底层原理 生命不息,写作不止 继续踏上学习之路,学之分享笔记 总有一天我也能像各位大佬一样 一个有梦有戏的人 @怒放吧德德 分享学习心得,欢迎指正,大家一起学习成长! 目录 Sprin ...

  5. 快捷打开cmd管理员模式

    win+s-搜索cmd 直接回车:普通用户模式的cmd CTRL+SHIFT+回车:管理员模式的cmd

  6. OSError: dlopen() failed to load a library: cairo / cairo-2 / cairo-gobject-2 / cairo.so.2

    解决办法 下载 gtk3-runtime-3.24.29-2021-04-29-ts-win64.exe后安装. 记得勾选添加bin目录到环境变量: 这样就不会缺失dll了,当然可能需要重启IDE才能 ...

  7. ajax 获取json值

    请求后台获取json: {"success":true,"datamap":{"rebackName":"振勋"}} a ...

  8. day25 前端

    https://www.dcloud.io/hbuilderx.html 下载HbuilderX,直接解压缩双击打开 html5 <!DOCTYPE html><!-- 文档类型,声 ...

  9. 【翻译】rocksdb调试指引

    rocksdb调试指引 翻译自官方wiki:https://github.com/facebook/rocksdb/wiki/RocksDB-Tuning-Guide 转载请注明出处:https:// ...

  10. 【Hadoop学习】中:HDFS、shell操作、客户端API操作、数据流、1NN、2NN原理、DataNode配置

    一.概述 1.背景.定义.使用场景(一次写入.不支持修改) 2.优(容错)缺点(延迟.不支持小文件.不支持修改) 3.组成架构 NameNode:Master,管理命名空间.配置策略 DataNode ...