You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by ib...@apache.org on 2020/02/28 20:49:48 UTC

[beam] branch master updated: [BEAM-9401] bind Flink MiniCluster to localhost

This is an automated email from the ASF dual-hosted git repository.

ibzib pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 5db8660  [BEAM-9401] bind Flink MiniCluster to localhost
     new 66066a4  Merge pull request #10995 from ibzib/flink-bind
5db8660 is described below

commit 5db86603877907ab9601b6432f9f53f0a3832044
Author: Kyle Weaver <kc...@google.com>
AuthorDate: Thu Feb 27 14:04:16 2020 -0800

    [BEAM-9401] bind Flink MiniCluster to localhost
---
 runners/flink/job-server/test_flink_uber_jar.sh                     | 2 +-
 .../org/apache/beam/runners/flink/FlinkMiniClusterEntryPoint.java   | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/runners/flink/job-server/test_flink_uber_jar.sh b/runners/flink/job-server/test_flink_uber_jar.sh
index 3656950..ace5da9 100755
--- a/runners/flink/job-server/test_flink_uber_jar.sh
+++ b/runners/flink/job-server/test_flink_uber_jar.sh
@@ -91,7 +91,7 @@ s.close()
 FLINK_PORT=$(python -c "$SOCKET_SCRIPT")
 
 echo "Starting Flink mini cluster listening on port $FLINK_PORT"
-java -Dorg.slf4j.simpleLogger.defaultLogLevel=warn -jar "$FLINK_MINI_CLUSTER_JAR" --rest-port "$FLINK_PORT" &
+java -Dorg.slf4j.simpleLogger.defaultLogLevel=warn -jar "$FLINK_MINI_CLUSTER_JAR" --rest-port "$FLINK_PORT" --rest-bind-address localhost &
 
 PIPELINE_PY="
 import apache_beam as beam
diff --git a/runners/flink/src/main/java/org/apache/beam/runners/flink/FlinkMiniClusterEntryPoint.java b/runners/flink/src/main/java/org/apache/beam/runners/flink/FlinkMiniClusterEntryPoint.java
index fec9a88..27072e4 100644
--- a/runners/flink/src/main/java/org/apache/beam/runners/flink/FlinkMiniClusterEntryPoint.java
+++ b/runners/flink/src/main/java/org/apache/beam/runners/flink/FlinkMiniClusterEntryPoint.java
@@ -36,6 +36,9 @@ public class FlinkMiniClusterEntryPoint {
     @Option(name = "--rest-port")
     int restPort = 0;
 
+    @Option(name = "--rest-bind-address")
+    String restBindAddress = "";
+
     @Option(name = "--num-task-managers")
     int numTaskManagers = 1;
 
@@ -48,6 +51,9 @@ public class FlinkMiniClusterEntryPoint {
 
     Configuration flinkConfig = new Configuration();
     flinkConfig.setInteger(RestOptions.PORT, miniClusterArgs.restPort);
+    if (!miniClusterArgs.restBindAddress.isEmpty()) {
+      flinkConfig.setString(RestOptions.BIND_ADDRESS, miniClusterArgs.restBindAddress);
+    }
 
     MiniClusterConfiguration clusterConfig =
         new MiniClusterConfiguration.Builder()