xintongsong commented on a change in pull request #11284: 
[FLINK-15911][runtime] Make Flink work with NAT.
URL: https://github.com/apache/flink/pull/11284#discussion_r396889856
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/minicluster/MiniCluster.java
 ##########
 @@ -261,26 +258,30 @@ public void start() throws Exception {
                                // bring up all the RPC services
                                LOG.info("Starting RPC Service(s)");
 
-                               AkkaRpcServiceConfiguration 
akkaRpcServiceConfig = 
AkkaRpcServiceConfiguration.fromConfiguration(configuration);
-
                                final RpcServiceFactory 
dispatcherResourceManagreComponentRpcServiceFactory;
 
                                if (useSingleRpcService) {
                                        // we always need the 
'commonRpcService' for auxiliary calls
-                                       commonRpcService = 
createRpcService(akkaRpcServiceConfig, false, null);
+                                       commonRpcService = 
createLocalRpcService(configuration);
                                        final CommonRpcServiceFactory 
commonRpcServiceFactory = new CommonRpcServiceFactory(commonRpcService);
                                        taskManagerRpcServiceFactory = 
commonRpcServiceFactory;
                                        
dispatcherResourceManagreComponentRpcServiceFactory = commonRpcServiceFactory;
                                } else {
-                                       // we always need the 
'commonRpcService' for auxiliary calls
-                                       commonRpcService = 
createRpcService(akkaRpcServiceConfig, true, null);
 
                                        // start a new service per component, 
possibly with custom bind addresses
                                        final String jobManagerBindAddress = 
miniClusterConfiguration.getJobManagerBindAddress();
                                        final String taskManagerBindAddress = 
miniClusterConfiguration.getTaskManagerBindAddress();
+                                       final String jobManagerBindPort = 
miniClusterConfiguration.getJobManagerBindPortRange();
+                                       final String taskManagerBindPort = 
miniClusterConfiguration.getTaskManagerBindPortRange();
+
+                                       
dispatcherResourceManagreComponentRpcServiceFactory =
+                                               new 
DedicatedRpcServiceFactory(configuration, jobManagerBindAddress, 
jobManagerBindPort);
 
 Review comment:
   I think you are right. A `DedicatedRpcServiceFactory` might be used to 
create multiple RPC services. In such cases, the current implementation will 
lead to conflicts on binding ports. To that end, I would agree with not 
supporting the binding port option and rely on the random port.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to