You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Michael Blow (Code Review)" <do...@asterixdb.incubator.apache.org> on 2016/08/11 20:43:04 UTC

Change in asterixdb[master]: Ensure RMI host is set to the cluster ip address

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 <mb...@apache.org>

Change in asterixdb[master]: Ensure RMI host is set to the cluster ip address

Posted by "Chris Hillery (Code Review)" <do...@asterixdb.incubator.apache.org>.
Chris Hillery has posted comments on this change.

Change subject: Ensure RMI host is set to the cluster ip address
......................................................................


Patch Set 2:

Mike - the client and cluster IPs for the CC are only the "public" IPs already. The client IP is obviously the one that external clients can see. As for cluster IP, the CC listens on all interfaces; the specific cluster IP is the one which is passed to NCs for connecting.

FYI, though, I'm no longer sure the whole public/private divide is really desirable. It was there primarily to support earlier limitations in Docker, but that's long ago. It'd still be useful if you were setting up a cluster where some nodes were behind NAT or something, but I can't imagine that's really a common use case. It might be worth stripping it out to avoid confusions.

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1065
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0fbda4ce14c892e66595d7a1cc3801f0fc2b8fba
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Chris Hillery <ce...@lambda.nu>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-HasComments: No

Change in asterixdb[master]: Ensure RMI host is set to the cluster ip address

Posted by "Michael Blow (Code Review)" <do...@asterixdb.incubator.apache.org>.
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 <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Chris Hillery <ce...@lambda.nu>
Reviewed-by: Till Westmann <ti...@apache.org>
---
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 <mb...@apache.org>
Gerrit-Reviewer: Chris Hillery <ce...@lambda.nu>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>

Change in asterixdb[master]: Ensure RMI host is set to the cluster ip address

Posted by "Chris Hillery (Code Review)" <do...@asterixdb.incubator.apache.org>.
Chris Hillery has posted comments on this change.

Change subject: Ensure RMI host is set to the cluster ip address
......................................................................


Patch Set 1: Code-Review+2

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1065
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0fbda4ce14c892e66595d7a1cc3801f0fc2b8fba
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Chris Hillery <ce...@lambda.nu>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-HasComments: No

Change in asterixdb[master]: Ensure RMI host is set to the cluster ip address

Posted by "Michael Blow (Code Review)" <do...@asterixdb.incubator.apache.org>.
Michael Blow has posted comments on this change.

Change subject: Ensure RMI host is set to the cluster ip address
......................................................................


Patch Set 1:

Chris, one thing that's not clear to me is why we don't want to have a "public" cluster IP address for CCs like we have for NCs.  It seems the same situation could happen that direction as well.

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1065
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0fbda4ce14c892e66595d7a1cc3801f0fc2b8fba
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Chris Hillery <ce...@lambda.nu>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-HasComments: No

Change in asterixdb[master]: Ensure RMI host is set to the cluster ip address

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: Ensure RMI host is set to the cluster ip address
......................................................................


Patch Set 1: Integration-Tests+1

Integration Tests Successful

https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-integration-tests/279/ : SUCCESS

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1065
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0fbda4ce14c892e66595d7a1cc3801f0fc2b8fba
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-HasComments: No

Change in asterixdb[master]: Ensure RMI host is set to the cluster ip address

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: Ensure RMI host is set to the cluster ip address
......................................................................


Patch Set 1:

Build Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/2165/

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1065
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0fbda4ce14c892e66595d7a1cc3801f0fc2b8fba
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-HasComments: No

Change in asterixdb[master]: Ensure RMI host is set to the cluster ip address

Posted by "Till Westmann (Code Review)" <do...@asterixdb.incubator.apache.org>.
Till Westmann has posted comments on this change.

Change subject: Ensure RMI host is set to the cluster ip address
......................................................................


Patch Set 1: Code-Review+1

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1065
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0fbda4ce14c892e66595d7a1cc3801f0fc2b8fba
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Chris Hillery <ce...@lambda.nu>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-HasComments: No

Change in asterixdb[master]: Ensure RMI host is set to the cluster ip address

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: Ensure RMI host is set to the cluster ip address
......................................................................


Patch Set 1:

Integration Tests Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-integration-tests/279/

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1065
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0fbda4ce14c892e66595d7a1cc3801f0fc2b8fba
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-HasComments: No