flink作业提交org.apache.flink.runtime.messages.FlinkJobNotFoundException:找不到Flink作业

时间:2020-03-19 13:33:06

标签: apache-flink flink-streaming

出现以下flink作业提交错误,

@centos1 flink-1.10.0]$ ./bin/flink run -m 10.0.2.4:8081 ./examples/batch/WordCount.jar --input file:///storage/flink-1.10.0/test.txt --output file:///storage/flink-1.10.0/wordcount_out
Job has been submitted with JobID 33d489aee848401e08c425b053c854f9

------------------------------------------------------------
 The program finished with the following exception:

org.apache.flink.client.program.ProgramInvocationException: The main method caused an error: org.apache.flink.runtime.rest.util.RestClientException: [org.apache.flink.runtime.rest.handler.RestHandlerException: org.apache.flink.runtime.messages.FlinkJobNotFoundException: Could not find Flink job (33d489aee848401e08c425b053c854f9)

....

    Caused by: java.util.concurrent.CompletionException: org.apache.flink.runtime.messages.FlinkJobNotFoundException: Could not find Flink job (33d489aee848401e08c425b053c854f9)
Caused by: org.apache.flink.runtime.messages.FlinkJobNotFoundException: Could not find Flink job (33d489aee848401e08c425b053c854f9)
        at org.apache.flink.runtime.dispatcher.Dispatcher.getJobMasterGatewayFuture(Dispatcher.java:776)
        at org.apache.flink.runtime.dispatcher.Dispatcher.requestJobStatus(Dispatcher.java:505)
        ... 27 more
]

从taskmanger节点记录日志:说未找到文件。是在flink群集设置中指向文件的正确方法。

2020-03-19 13:15:29,843 ERROR org.apache.flink.runtime.operators.BatchTask                  - Error in task code:  CHAIN DataSource (at main(WordCount.java:69) (org.apache.flink.api.java.io.TextInputFormat)) -> FlatMap (FlatMap at main(WordCount.java:84)) -> Combine (SUM(1), at main(WordCount.java:87) (1/2)
java.io.IOException: Error opening the Input Split file:/storage/flink-1.10.0/test.txt [0,19]: /storage/flink-1.10.0/test.txt (No such file or directory)
        at org.apache.flink.api.common.io.FileInputFormat.open(FileInputFormat.java:824)
        at org.apache.flink.api.common.io.DelimitedInputFormat.open(DelimitedInputFormat.java:470)

如何解决上述错误,要检查的内容,以及flink日志中的线索很少

1 个答案:

答案 0 :(得分:1)

发生这种情况的原因是,您正在跨分布式集群提交作业,并且您只能通过Job manager或提交作业的计算机访问指定的位置。但是,实际的程序和作业执行在Task Manager中进行。更好的方法是指定所有节点都可以访问的位置,可以是HDFS或NFS。