Search code examples
mapreduceapache-flinkflink-streaming

How to submit a job, by using an uploaded jar in Apache Flink?


I've already uploaded a jar (which was generated through a word count java program) to Apache Flink web console through an HTTP Post request via curl and the get jars api shows the uploaded jar.

When I try to submit a job using that jar, it throws me this error:

Caused by: org.apache.flink.client.program.ProgramInvocationException: JAR file does not exist '/tmp/flink-web-8aa36f99-87fb-4fbc-b155-237fd833fc32/:949611ce-345a-4cd5-986b-8ff9b0700852_WordCount.jar'

This is how my POST request looks like:

http://localhost:8081/jars/:949611ce-345a-4cd5-986b-8ff9b0700852_WordCount.jar/run

I followed their official docs for reference. Where am i going wrong? Any help could be appreciated.


Solution

  • Ensure that the jar file is located in your temp directory. There is a ':' in path, is it correct?

    I study REST API recently and successfully submit my job with POST request

    http://host:port/jars/29525e98-3ece-49c1-85d1-5301a5a38900_myjob.jar/run?allowNonRestoredState=false&entry-class=&parallelism=&program-args=&savepointPath=
    

    Also you can submit job via Flink Dashboard and detect correct url through Chrome DevToos at Network tab (or something like this)