How can I start the Flink job manager web interface when running Flink from an IDE

前端 未结 2 1149
南旧
南旧 2020-12-09 19:17

I would like to access the Flink Web interface when starting it locally from the IDE.

I need this because I\'d like to access the counters (accumulators) of Flink.

2条回答
  •  余生分开走
    2020-12-09 19:45

    In order to start the web interface when starting Flink locally, we have to enable the web interface in the FlinkMiniCluster. The FlinkMiniCluster is the class managing the startup of all Flink services locally.

    Include the dependency:

    
      org.apache.flink
      flink-runtime-web_${scala.binary.version}
      ${flink.version}
    
    

    The following snippet will enable the web interface for a StreamExecutionEnvironment:

    // set up the execution environment
    Configuration conf = new Configuration();
    conf.setBoolean(ConfigConstants.LOCAL_START_WEBSERVER, true);
    final StreamExecutionEnvironment env = StreamExecutionEnvironment.createLocalEnvironment(8, conf);
    

    You can also use RestOptions to configure the server:

    conf.setInteger(RestOptions.PORT, 8082);
    

提交回复
热议问题