Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-15154

Change Flink binding addresses in local mode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.9.1
    • 1.11.0
    • Runtime / Coordination
    • ```
      $ uname -a
      Linux xxx 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/Linux
      ```

    Description

      Flink (or some of its services) listens on three random TCP ports
      during the local[1] execution, e.g., 39951, 41009 and 42849.

      [1]: https://ci.apache.org/projects/flink/flink-docs-stable/dev/local_execution.html#local-environment

      The sockets listens on `0.0.0.0` and since I need to run some
      long-running tests on an Internet-facing machine I was wondering how
      to make them listen on `localhost` instead or if there is anything
      else I can do to improve the security in this scenario.

      Here's what I tried (with little luck):

      ```
      Configuration config = new Configuration();
      config.setString("taskmanager.host", "127.0.0.1");
      cconfig.setString("rest.bind-address", "127.0.0.1"); // OK
      config.setString("jobmanager.rpc.address", "127.0.0.1");
      StreamExecutionEnvironment env = StreamExecutionEnvironment.createLocalEnvironment(StreamExecutionEnvironment.getDefaultLocalParallelism(), config);
      ```

      Only the `rest.bind-address` configuration actually changes the
      binding address of one of those ports. Are there other parameters that
      I'm not aware of or this is not the right approach in local mode?

      Attachments

        Issue Links

          Activity

            People

              xtsong Xintong Song
              cyrusand Andrea Cardaci
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: