Michael Blow has submitted this change and it was merged. Change subject: Ensure RMI host is set to the cluster ip address ......................................................................
Ensure RMI host is set to the cluster ip address By default RMI stubs reference InetAddress.getLocalHost(), which may not be reachable from the CC / NC. Unless explicitly set, bind it to the cluster net ip address, public in case of NC. Change-Id: I0fbda4ce14c892e66595d7a1cc3801f0fc2b8fba Reviewed-on: https://asterix-gerrit.ics.uci.edu/1065 Sonar-Qube: Jenkins <[email protected]> Tested-by: Jenkins <[email protected]> Integration-Tests: Jenkins <[email protected]> Reviewed-by: Chris Hillery <[email protected]> Reviewed-by: Till Westmann <[email protected]> --- M asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplicationEntryPoint.java M asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplicationEntryPoint.java 2 files changed, 11 insertions(+), 0 deletions(-) Approvals: Chris Hillery: Looks good to me, approved Till Westmann: Looks good to me, but someone else must approve Jenkins: Verified; No violations found; Verified diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplicationEntryPoint.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplicationEntryPoint.java index b6ce217..28cbe11 100644 --- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplicationEntryPoint.java +++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplicationEntryPoint.java @@ -96,6 +96,11 @@ AsterixAppContextInfo.initialize(appCtx, getNewHyracksClientConnection(), GlobalRecoveryManager.INSTANCE, libraryManager); + if (System.getProperty("java.rmi.server.hostname") == null) { + System.setProperty("java.rmi.server.hostname", + ((ClusterControllerService) ccAppCtx.getControllerService()).getCCConfig().clusterNetIpAddress); + } + proxy = AsterixStateProxy.registerRemoteObject(); appCtx.setDistributedState(proxy); diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplicationEntryPoint.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplicationEntryPoint.java index 2555b5a..4cb9d70 100644 --- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplicationEntryPoint.java +++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplicationEntryPoint.java @@ -95,6 +95,12 @@ LOGGER.info("Starting Asterix node controller: " + nodeId); } + if (System.getProperty("java.rmi.server.hostname") == null) { + System.setProperty("java.rmi.server.hostname", + ((NodeControllerService) ncAppCtx.getControllerService()) + .getConfiguration().clusterNetPublicIPAddress); + } + runtimeContext = new AsterixAppRuntimeContext(ncApplicationContext, metadataRmiPort); AsterixMetadataProperties metadataProperties = ((IAsterixPropertiesProvider) runtimeContext) .getMetadataProperties(); -- To view, visit https://asterix-gerrit.ics.uci.edu/1065 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0fbda4ce14c892e66595d7a1cc3801f0fc2b8fba Gerrit-PatchSet: 2 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Michael Blow <[email protected]> Gerrit-Reviewer: Chris Hillery <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Michael Blow <[email protected]> Gerrit-Reviewer: Till Westmann <[email protected]>
