问题:FlinkCDC 3.1.0 pipeline 与 Flink 1.17.0 可能是因为出现版本不支持的问题(已实测)
持续报错:
-- client log
Exception in thread "main" java.lang.BootstrapMethodError: java.lang.NoSuchMethodError: org.apache.doris.flink.cfg.DorisOptions$Builder.setBenodes(Ljava/lang/String;)Lorg/apache/doris/flink/cfg/DorisOptions$Builder;
at org.apache.flink.cdc.connectors.doris.factory.DorisDataSinkFactory.createDataSink(DorisDataSinkFactory.java:70)
at org.apache.flink.cdc.composer.flink.FlinkPipelineComposer.createDataSink(FlinkPipelineComposer.java:164)
at org.apache.flink.cdc.composer.flink.FlinkPipelineComposer.compose(FlinkPipelineComposer.java:129)
at org.apache.flink.cdc.cli.CliExecutor.run(CliExecutor.java:71)
at org.apache.flink.cdc.cli.CliFrontend.main(CliFrontend.java:71)
Caused by: java.lang.NoSuchMethodError: org.apache.doris.flink.cfg.DorisOptions$Builder.setBenodes(Ljava/lang/String;)Lorg/apache/doris/flink/cfg/DorisOptions$Builder;
at java.lang.invoke.MethodHandleNatives.resolve(Native Method)
at java.lang.invoke.MemberName$Factory.resolve(MemberName.java:975)
at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1000)
at java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:1394)
at java.lang.invoke.MethodHandles$Lookup.linkMethodHandleConstant(MethodHandles.java:1750)
at java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:477)
... 5 more
-- cdc log
2024-06-14 16:09:21,947 ERROR org.apache.flink.cdc.cli.utils.YamlParserUtils [] - Failed to find YAML file
java.io.FileNotFoundException: /data/software/flink/flink-1.17.0/conf/config.yaml (没有那个文件或目录)
at java.io.FileInputStream.open0(Native Method) ~[?:1.8.0_181]
at java.io.FileInputStream.open(FileInputStream.java:195) ~[?:1.8.0_181]
at java.io.FileInputStream.<init>(FileInputStream.java:138) ~[?:1.8.0_181]
at org.apache.flink.cdc.cli.utils.YamlParserUtils.loadYamlFile(YamlParserUtils.java:131) [flink-cdc-dist-3.1.0.jar:3.1.0]
at org.apache.flink.cdc.cli.utils.ConfigurationUtils.loadConfigFile(ConfigurationUtils.java:39) [flink-cdc-dist-3.1.0.jar:3.1.0]
at org.apache.flink.cdc.cli.utils.ConfigurationUtils.loadConfigFile(ConfigurationUtils.java:33) [flink-cdc-dist-3.1.0.jar:3.1.0]
at org.apache.flink.cdc.cli.utils.FlinkEnvironmentUtils.loadFlinkConfiguration(FlinkEnvironmentUtils.java:42) [flink-cdc-dist-3.1.0.jar:3.1.0]
at org.apache.flink.cdc.cli.CliFrontend.createExecutor(CliFrontend.java:98) [flink-cdc-dist-3.1.0.jar:3.1.0]
at org.apache.flink.cdc.cli.CliFrontend.main(CliFrontend.java:71) [flink-cdc-dist-3.1.0.jar:3.1.0]
原因:初步判断是由于flinkcdc不同开发团队使用的flink-cdc-pipeline-connector-doris-3.1.0.jar包内是基于判断flink-1.17.0/conf/config.yaml的flink conf文件而导致,而实际上1.17版本的flink conf/下只有flink-conf.yaml配置文件,在参考原配置手动添加config.yaml文件后仍然无效
解决:重新安装flinkcdc 3.1.0适配的flink版本 1.18,为官方推荐,而flink 1.19虽然是当前20240614的最新stable版本,但是阿里云开发者flinkcdc钉群社区中似乎还是有出现部分问题的可能,所以还是采用flinkcdc官方推荐的flink版本最佳
参考:在Flink CDC中请问3.1.0的支持flink 1.16 的吧?_问答-阿里云开发者社区