Flink 中关闭 checkpoint 可以通过以下两种方式来实现:

  1. 在代码中设置关闭 checkpoint

可以通过在代码中设置以下参数来关闭 checkpoint:

env.getCheckpointConfig().setCheckpointingMode(CheckpointingMode.EXACTLY_ONCE);
env.getCheckpointConfig().setCheckpointInterval(0);

其中,'CheckpointingMode.EXACTLY_ONCE' 表示精确一次的 checkpoint 模式,'0' 表示关闭 checkpoint,即不进行 checkpoint。

  1. 在 flink-conf.yaml 中设置关闭 checkpoint

可以在 flink-conf.yaml 中设置以下参数来关闭 checkpoint:

# 关闭 checkpoint
flink.checkpointing.interval: 0

其中,'flink.checkpointing.interval' 表示 checkpoint 间隔时间,设置为 '0' 表示关闭 checkpoint。

Flink 关闭 Checkpoint 的两种方法