提交至集群从ck恢复
通过 -s 参数从 检查点恢复,检查点可以是 checkpoint 、savePoint,两者使用上几乎一样,细节上有区别
flink run -s /checkpoint-path/chk-n
本地调试从ck 恢复
execution.savepoint.path
注入 config 中使用
Configuration conf = new Configuration();
conf.setInteger(HEARTBEAT_TIMEOUT.key(), 60 * 1000 * 60);
conf.setString("execution.savepoint.path", "file:///tmp/flink-checkpointsdwd/650de825a8df2e72a1be54e9dd87c8c4/chk-1");
conf.setInteger(RestOptions.PORT, 8088);
StreamExecutionEnvironment env = StreamExecutionEnvironment.createLocalEnvironmentWithWebUI(conf);
需要开启 checkpoint
CheckpointConfig checkpointConfig = env.getCheckpointConfig();
checkpointConfig.setCheckpointInterval(2 * 60 * 1000);
checkpointConfig.setMinPauseBetweenCheckpoints(1000 * 60);
checkpointConfig.setCheckpointTimeout(10 * 60 * 1000);
String ckPatch = "file:///tmp/flink-checkpointsdwd";
checkpointConfig.setCheckpointStorage(new FileSystemCheckpointStorage(
new Path(ckPatch)));