从IDE运行Flink时如何启动Flink作业管理器Web界面 [英] How can I start the Flink job manager web interface when running Flink from an IDE

查看:1050
本文介绍了从IDE运行Flink时如何启动Flink作业管理器Web界面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从IDE本地启动Flink Web界面时,我想访问它.

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

我需要这个,因为我想访问Flink的计数器(累加器).

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

推荐答案

为了在本地启动Flink时启动Web界面,我们必须在FlinkMiniCluster中启用Web界面. FlinkMiniCluster是管理所有Flink服务在本地启动的类.

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.

包括依赖项:

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

以下代码段将启用StreamExecutionEnvironment的Web界面:

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);

您还可以使用 RestOptions 来配置服务器:

You can also use RestOptions to configure the server:

conf.setInteger(RestOptions.PORT, 8082);

这篇关于从IDE运行Flink时如何启动Flink作业管理器Web界面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆