[hotfix] Enable standalone HA mode by choosing HA port range

Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/344a4775
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/344a4775
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/344a4775

Branch: refs/heads/master
Commit: 344a47756fb2723a1f5fda2b67315c27f2125423
Parents: 2d3c5d5
Author: Till Rohrmann <trohrm...@apache.org>
Authored: Fri Mar 2 20:31:36 2018 +0100
Committer: Till Rohrmann <trohrm...@apache.org>
Committed: Fri Mar 2 23:43:31 2018 +0100

----------------------------------------------------------------------
 .../apache/flink/runtime/entrypoint/ClusterEntrypoint.java   | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/344a4775/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/ClusterEntrypoint.java
----------------------------------------------------------------------
diff --git 
a/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/ClusterEntrypoint.java
 
b/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/ClusterEntrypoint.java
index 19781f8..07b3b68 100755
--- 
a/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/ClusterEntrypoint.java
+++ 
b/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/ClusterEntrypoint.java
@@ -24,6 +24,7 @@ import org.apache.flink.configuration.ConfigOption;
 import org.apache.flink.configuration.ConfigOptions;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.configuration.GlobalConfiguration;
+import org.apache.flink.configuration.HighAvailabilityOptions;
 import org.apache.flink.configuration.JobManagerOptions;
 import org.apache.flink.configuration.RestOptions;
 import org.apache.flink.configuration.WebOptions;
@@ -59,6 +60,7 @@ import org.apache.flink.runtime.rpc.akka.AkkaRpcService;
 import org.apache.flink.runtime.security.SecurityConfiguration;
 import org.apache.flink.runtime.security.SecurityContext;
 import org.apache.flink.runtime.security.SecurityUtils;
+import org.apache.flink.runtime.util.ZooKeeperUtils;
 import org.apache.flink.runtime.webmonitor.WebMonitorEndpoint;
 import org.apache.flink.runtime.webmonitor.retriever.LeaderGatewayRetriever;
 import 
org.apache.flink.runtime.webmonitor.retriever.MetricQueryServiceRetriever;
@@ -354,7 +356,11 @@ public abstract class ClusterEntrypoint implements 
FatalErrorHandler {
         * @return Port range for the common {@link RpcService}
         */
        protected String getRPCPortRange(Configuration configuration) {
-               return 
String.valueOf(configuration.getInteger(JobManagerOptions.PORT));
+               if (ZooKeeperUtils.isZooKeeperRecoveryMode(configuration)) {
+                       return 
configuration.getString(HighAvailabilityOptions.HA_JOB_MANAGER_PORT_RANGE);
+               } else {
+                       return 
String.valueOf(configuration.getInteger(JobManagerOptions.PORT));
+               }
        }
 
        protected RpcService createRpcService(

Reply via email to