0

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?

uri go
  • 105
  • 5
  • Follow these two threads: https://stackoverflow.com/questions/46988499/flink-webui-when-running-from-ide/47000955#47000955 https://stackoverflow.com/questions/35138538/how-can-i-start-the-flink-job-manager-web-interface-when-running-flink-from-an-i – Sparkle8 Nov 17 '19 at 15:13
  • why you checking os name?? – Mohammad Hossein Gerami Nov 18 '19 at 09:01

2 Answers2

2

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");
Arvid Heise
  • 3,524
  • 5
  • 11
1

One can change the default port mapping in ../conf/flink-conf.yml file.

rest.port: 18081

or use port range e.g.

rest.bind-port: 18080-18090
Satish
  • 1,037
  • 1
  • 13
  • 20