为 Yarn 集群中的 Flink 作业设置 Flink 检查点的动态路径

Set path dynamic for Flink Checkpoint for Flink Job in Yarn Cluser

我将 Yarn 用于 运行 Flink 作业。我正在为每个 Flink 作业创建一个检查点。

我提交了一个在我的 Yarn 集群中运行的 Flink 作业。我有一个轮询作业,它检查 Yarn 上的作业是否失败并重新启动它。当作业再次提交时,Yarn 会为这个 Flink 作业创建一个新的 application_id。如何配置重新提交的 Flink 作业使用重新启动的 Flink 作业的检查点。

我已经设置好了 state.savepoints.dir = hdfs://localhost:9000/checkpoint/ 在 flink-conf.yaml`

创建 Flink 作业时, streamExecutionEnvironment.setStateBackend(new FsStateBackend("hdfs://localhost:9000/checkpoint/uuid-job-1"));

当我进行此设置时,检查点保存在 conf 文件 (hdfs://localhost:9000/checkpoint/) 中指定的路径中,而不是我在创建 Flink 作业时设置的路径中。

任何帮助将不胜感激。谢谢!

很遗憾,您无法使用旧作业的检查点开始新作业。你可以做的是使用externalized checkpoints。 flink <=1.5 的一个缺点是外部检查点的元数据存储在所有作业的单个目录中,该目录由配置参数设置:state.checkpoints.dir。但您可以在每次提交前更改它。

来自邮件列表的附加说明 thread:

The good news is that Flink 1.5 will rework how externalized checkpoints work a bit: basically, all checkpoints can now be considered externalized and the metadata will be stored in the root directory of the checkpoint, not in one global directory for all jobs. This way, the metadata for externalized checkpoints resides in the checkpoint directory of each job and it should be reasonably simple to restore from that.