作者:零摄氏度玫瑰_460 | 来源:互联网 | 2023-07-30 11:15
flink在本地idea调试出现webUI
添加maven依赖:
org.apache.flinkflink-runtime-web_2.111.8.0
关键代码:
import org.apache.flink.configuration.ConfigConstants;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.configuration.TaskManagerOptions;Configuration cfg = new Configuration();
cfg.setBoolean(ConfigConstants.LOACAL_START_WEBSERVER, true);
cfg.setInteger(TaskManagerOptions.NUM_TASK_SLOTS, 6);
final StreamExecutionEnvironment env = StreamExecutionEnvironment.createExecutionEnvironment.createLocalEnvironmentWithWebUI(cfg).enableCheckpointing(10000);
运行后,浏览器打开http://localhost:8081/ 即可