尝试使用webUI运行本地主机时无法启动flink [英] Cannot launch flink from local host when trying to run it with webUI

查看:878
本文介绍了尝试使用webUI运行本地主机时无法启动flink的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用flink UI从intellij调试我的flink. 无法启动抛出java.net.BindException的问题:无法在端口范围8081中的任何端口上启动Rest端点

我应该让flink ui(从Windows)运行的代码片段是:

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

你能帮忙吗?

解决方案

如果您无法绑定到给定的网络端口,则通常意味着该端口已被占用.因此,请检查该端口上是否正在运行任何进程(旧的作业管理器?)并将其杀死.

或者,您可以使用以下方式更改端口

conf.setInteger(RestOptions.PORT, 8082);

或者如果要在保存侧指定范围

conf.setString(RestOptions.BIND_PORT, "8081-8099");

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

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

can you assist please?

解决方案

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.

Alternatively, you can change the port with

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屋!

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