Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Apache Flink's detached mode?

Tags:

apache-flink

I saw this line in Flink documentation but can't figure out what 'detached mode' means. Please help. Thanks.

Run example program in detached mode:

./bin/flink run -d ./examples/batch/WordCount.jar
like image 991
Son Avatar asked Nov 16 '18 06:11

Son


1 Answers

The Flink CLI runs jobs either in blocking or detached mode. In blocking mode, the CliFrontend (client) process keeps running, blocked, waiting for the job to complete -- after which it will print out some information. In the example below I ran a streaming job, which I cancelled from the WebUI after a few seconds:

$ flink run target/oscon-1.0-SNAPSHOT.jar 
Starting execution of program
Program execution finished
Job with JobID b02da01c30585bfbc86a23446559987f has finished.
Job Runtime: 8673 ms

If you run in blocking mode, you can kill the CliFrontend (e.g., with ctrl-C) if you like, and the job will be unaffected, so long as it has run far enough to have submitted the job to the cluster.

In detached mode, the CliFrontend submits the job to the cluster and then exits straight away.

like image 163
David Anderson Avatar answered Sep 26 '22 23:09

David Anderson