Cannot launch flink from local host when trying to run it with webUI

天大地大妈咪最大 提交于 2020-05-17 05:53:12

问题


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?


回答1:


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


来源:https://stackoverflow.com/questions/58898543/cannot-launch-flink-from-local-host-when-trying-to-run-it-with-webui

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!