Michael Blow has uploaded a new change for review.
https://asterix-gerrit.ics.uci.edu/1065
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
---
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(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb
refs/changes/65/1065/1
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: newchange
Gerrit-Change-Id: I0fbda4ce14c892e66595d7a1cc3801f0fc2b8fba
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <[email protected]>