尝试使用 webUI 运行 flink 时无法从本地主机启动它 [英] Cannot launch flink from local host when trying to run it with webUI
问题描述
我正在尝试使用 flink UI 从 intellij 调试我的 flink.问题它somethims没有启动抛出java.net.BindException:无法在端口范围8081的任何端口上启动rest端点
I'm trying to debug my flink from intellij using the flink UI. the problem it somethims doesn't launched throwing java.net.BindException: Could not start rest endpoint on any port in port range 8081
我应该让 flink ui 运行(从 Windows)的代码是:
my piece of code that should let the flink ui run (from windows) is:
String osName = System.getProperty("os.name");
if (osName.toLowerCase().contains("win")) {
Configuration conf = new Configuration();
conf.setBoolean(ConfigConstants.LOCAL_START_WEBSERVER, true);
env = StreamExecutionEnvironment.createLocalEnvironmentWithWebUI(conf);
} else {
env = StreamExecutionEnvironment.getExecutionEnvironment();
}
你能帮忙吗?
推荐答案
如果您无法绑定到给定的网络端口,通常意味着它已被占用.因此,请检查该端口上是否有任何进程正在运行(旧作业管理器?)并杀死它.
If you cannot bind to a given network port that usually means it has been already taken. So check if there is any process running on that port (old job manager?) and kill it.
或者,您可以使用
conf.setInteger(RestOptions.PORT, 8082);
或者如果想要在保存端指定一个范围
or if want to be on the save side specify a range
conf.setString(RestOptions.BIND_PORT, "8081-8099");
这篇关于尝试使用 webUI 运行 flink 时无法从本地主机启动它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!