Flink10 Per-JOB Could not build the program from JAR file.

【问题描述】:

   Could not build the program from JAR file.
   Use the help option (-h or --help) to get help on the command.

【产生原因】:之前 per-job启动的时候,它们都用 flink1.8 所以使用了如下命令:

[root@hadoop1 flink-1.10.1]# bin/flink run -m yarn-cluster -yn 2 -d ./examples/streaming/WordCount.jar 

【问题解决】:查看日志 cat flink-root-client-hadoop1.log 发现如下错误

 1 org.apache.flink.client.cli.CliArgsException: Could not build the program from JAR file.
 2     at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:200)
 3     at org.apache.flink.client.cli.CliFrontend.parseParameters(CliFrontend.java:893)
 4     at org.apache.flink.client.cli.CliFrontend.lambda$main$10(CliFrontend.java:966)
 5     at java.security.AccessController.doPrivileged(Native Method)
 6     at javax.security.auth.Subject.doAs(Subject.java:422)
 7     at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1754)
 8     at org.apache.flink.runtime.security.HadoopSecurityContext.runSecured(HadoopSecurityContext.java:41)
 9     at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:966)
10 Caused by: java.io.FileNotFoundException: JAR file does not exist: -yn
11     at org.apache.flink.client.cli.CliFrontend.getJarFile(CliFrontend.java:717)
12     at org.apache.flink.client.cli.CliFrontend.buildProgram(CliFrontend.java:693)
13     at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:197)
14     ... 7 more

我就将 -yn(yarncontainer 表示 TaskManager 的个数) 去掉使用默认的TaskManager个数。就能够正常启动:

[root@hadoop1 flink-1.10.1]# bin/flink run -m yarn-cluster -d ./examples/streaming/WordCount.jar 
posted @ 2020-11-20 17:12  Java程序员进阶  阅读(91)  评论(0编辑  收藏  举报