Apache Flink Kubernetes工作参数

时间:2018-10-09 15:01:38

标签: apache-flink flink-streaming

我正在尝试使用Kubernetes设置集群(Apache Flink 1.6.1)并在运行作业时出现以下错误:

2018-10-09 14:29:43.212 [main] INFO  org.apache.flink.runtime.entrypoint.ClusterEntrypoint  - --------------------------------------------------------------------------------
2018-10-09 14:29:43.214 [main] INFO  org.apache.flink.runtime.entrypoint.ClusterEntrypoint  - Registered UNIX signal handlers for [TERM, HUP, INT]
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.flink.runtime.entrypoint.ClusterConfiguration.<init>(Ljava/lang/String;Ljava/util/Properties;[Ljava/lang/String;)V
    at org.apache.flink.runtime.entrypoint.EntrypointClusterConfiguration.<init>(EntrypointClusterConfiguration.java:37)
    at org.apache.flink.container.entrypoint.StandaloneJobClusterConfiguration.<init>(StandaloneJobClusterConfiguration.java:41)
    at org.apache.flink.container.entrypoint.StandaloneJobClusterConfigurationParserFactory.createResult(StandaloneJobClusterConfigurationParserFactory.java:78)
    at org.apache.flink.container.entrypoint.StandaloneJobClusterConfigurationParserFactory.createResult(StandaloneJobClusterConfigurationParserFactory.java:42)
    at org.apache.flink.runtime.entrypoint.parser.CommandLineParser.parse(CommandLineParser.java:55)
    at org.apache.flink.container.entrypoint.StandaloneJobClusterEntryPoint.main(StandaloneJobClusterEntryPoint.java:153)

我的工作将配置文件(file.properties)作为参数。在独立模式下可以正常工作,但显然Kubernetes集群无法解析

job-cluster-job.yaml:

args: ["job-cluster", "--job-classname", "com.test.Abcd", "-Djobmanager.rpc.address=flink-job-cluster",
       "-Dparallelism.default=1", "-Dblob.server.port=6124", "-Dquery.server.ports=6125", "file.properties"]

该如何解决?

更新:该作业是为Apache 1.4.2构建的,因此调查可能是问题所在。

1 个答案:

答案 0 :(得分:0)

该作业是为1.4.2构建的,似乎在1.6.1(https://github.com/apache/flink/commit/ab9bd87e521d19db7c7d783268a3532d2e876a5d#diff-d1169e00afa40576ea8e4f3c472cf858)中添加了带有错误(EntrypointClusterConfiguration.java)的类,所以这引起了问题。 我们更新了作业的依赖关系以指向新的1.6.1版本,并且正确解析了参数。