目的: 调试时,每次打开web-UI 都需要到日志中寻找端口,  此处希望指定确定的端口

 

添加依赖:

      <flink.version>1.13.1</flink.version>
      <scala.binary.version>2.12</scala.binary.version>
<dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-runtime-web_${scala.binary.version}</artifactId> <version>${flink.version}</version> </dependency>

方式一:

        // 启动一个webUI,指定本地WEB-UI端口号
        Configuration configuration = new Configuration();
        configuration.setInteger(RestOptions.PORT, 8081);
        StreamExecutionEnvironment evn = StreamExecutionEnvironment.getExecutionEnvironment(configuration);

方式二:

      // 启动一个webUI,指定本地WEB-UI端口号
        Configuration configuration = new Configuration();
        configuration.setInteger(RestOptions.PORT, 8081);
        StreamExecutionEnvironment env = StreamExecutionEnvironment.createLocalEnvironmentWithWebUI(configuration);

 

 

localhost:8082

posted on 2022-07-21 11:02  lshan  阅读(2068)  评论(0编辑  收藏  举报