brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [5/9] git commit: MongoDBServer: fix logging of consolePort != (port+1000)
Date Mon, 03 Nov 2014 14:24:57 GMT
MongoDBServer: fix logging of consolePort != (port+1000)

Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/cc0980c2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/cc0980c2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/cc0980c2

Branch: refs/heads/master
Commit: cc0980c23cd354cc82bd419ee20b5344bccbd6a7
Parents: f579b76
Author: Aled Sage <aled.sage@gmail.com>
Authored: Mon Nov 3 11:24:04 2014 +0000
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Mon Nov 3 11:24:04 2014 +0000

----------------------------------------------------------------------
 .../brooklyn/entity/nosql/mongodb/MongoDBServerImpl.java | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cc0980c2/software/nosql/src/main/java/brooklyn/entity/nosql/mongodb/MongoDBServerImpl.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/brooklyn/entity/nosql/mongodb/MongoDBServerImpl.java
b/software/nosql/src/main/java/brooklyn/entity/nosql/mongodb/MongoDBServerImpl.java
index 7aa992d..b606ecb 100644
--- a/software/nosql/src/main/java/brooklyn/entity/nosql/mongodb/MongoDBServerImpl.java
+++ b/software/nosql/src/main/java/brooklyn/entity/nosql/mongodb/MongoDBServerImpl.java
@@ -61,12 +61,17 @@ public class MongoDBServerImpl extends SoftwareProcessImpl implements
MongoDBSer
         super.connectSensors();
         connectServiceUpIsRunning();
 
-        int httpConsolePort = getAttribute(PORT) + 1000;
-        if (httpConsolePort != getAttribute(HTTP_PORT)+1000) {
+        int port = getAttribute(PORT);
+        int httpConsolePort = getAttribute(HTTP_PORT);
+        if (httpConsolePort !=  port + 1000) {
             // see comment on HTTP_PORT
-            LOG.warn(this+" may not have opened HTTP_PORT correctly as the default was not
available");
+            LOG.warn("{} may not have opened HTTP_PORT correctly as the default was not available:
port={}; consolePort={}; resetting consolePort to {}", 
+                    new Object[] {this, port, httpConsolePort, port + 1000});
+            httpConsolePort = port + 1000;
             setAttribute(HTTP_PORT, httpConsolePort);
         }
+
+        
         setAttribute(HTTP_INTERFACE_URL, String.format("http://%s:%d", getAttribute(HOSTNAME),
httpConsolePort));
         setAttribute(MONGO_SERVER_ENDPOINT, String.format("http://%s:%d", getAttribute(HOSTNAME),
getAttribute(MongoDBServer.PORT)));
 


Mime
View raw message