且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Apache Flink的分离模式是什么?

更新时间:2023-01-10 21:34:16

Flink CLI以阻塞或分离模式运行作业.在阻止模式下,CliFrontend(客户端)进程保持运行,被阻止,等待作业完成-之后将打印出一些信息.在下面的示例中,我运行了一个流作业,几秒钟后我从WebUI取消了该作业:

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

如果在阻止模式下运行,则可以根据需要杀死CliFrontend(例如,使用ctrl-C),并且该作业不会受到影响,只要它的运行速度足以将作业提交给群集即可.

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.

在分离模式下,CliFrontend将作业提交到群集,然后立即退出.

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