aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-application/src
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@searchbox.com>2014-08-06 15:33:29 +0200
committerStephane Gamard <stephane.gamard@searchbox.com>2014-08-06 15:33:29 +0200
commit36bf1c9ec419315e478b247baea9bc1468f305b9 (patch)
tree0e54591fb1ad2b6cb953c5ca374a0590f613288b /sonar-application/src
parent51c7b2f22b09d25e460d9b9b8091733512b3e1f7 (diff)
downloadsonarqube-36bf1c9ec419315e478b247baea9bc1468f305b9.tar.gz
sonarqube-36bf1c9ec419315e478b247baea9bc1468f305b9.zip
SONAR-4907 - Added naming for search and server within a node.
Diffstat (limited to 'sonar-application/src')
-rw-r--r--sonar-application/src/main/java/org/sonar/application/App.java2
-rw-r--r--sonar-application/src/main/java/org/sonar/application/DefaultSettings.java6
2 files changed, 8 insertions, 0 deletions
diff --git a/sonar-application/src/main/java/org/sonar/application/App.java b/sonar-application/src/main/java/org/sonar/application/App.java
index 66e3b7a1e26..49c4d30075b 100644
--- a/sonar-application/src/main/java/org/sonar/application/App.java
+++ b/sonar-application/src/main/java/org/sonar/application/App.java
@@ -56,6 +56,7 @@ public class App implements ProcessMXBean {
.addJavaOpts(String.format("-Dsonar.path.logs=%s", installation.logsDir().getAbsolutePath()))
.setClassName("org.sonar.search.SearchServer")
.addProperties(installation.props().rawProperties())
+ .addProperty(DefaultSettings.SONAR_NODE_NAME, installation.prop(DefaultSettings.SONAR_NODE_NAME, DefaultSettings.getNonSetNodeName()))
.addClasspath(installation.starPath("lib/common"))
.addClasspath(installation.starPath("lib/search"));
if (elasticsearch.execute()) {
@@ -73,6 +74,7 @@ public class App implements ProcessMXBean {
.addJavaOpts(String.format("-Dsonar.path.logs=%s", installation.logsDir().getAbsolutePath()))
.setClassName("org.sonar.server.app.WebServer")
.addProperties(installation.props().rawProperties())
+ .addProperty(DefaultSettings.SONAR_NODE_NAME, installation.prop(DefaultSettings.SONAR_NODE_NAME, DefaultSettings.getNonSetNodeName()))
.addClasspath(installation.starPath("extensions/jdbc-driver/mysql"))
.addClasspath(installation.starPath("extensions/jdbc-driver/mssql"))
.addClasspath(installation.starPath("extensions/jdbc-driver/oracle"))
diff --git a/sonar-application/src/main/java/org/sonar/application/DefaultSettings.java b/sonar-application/src/main/java/org/sonar/application/DefaultSettings.java
index 7e3634c5423..e97619c4992 100644
--- a/sonar-application/src/main/java/org/sonar/application/DefaultSettings.java
+++ b/sonar-application/src/main/java/org/sonar/application/DefaultSettings.java
@@ -28,6 +28,12 @@ class DefaultSettings {
// only static stuff
}
+ static final String SONAR_NODE_NAME = "sonar.node.name";
+
+ static String getNonSetNodeName() {
+ return "sonar-" + System.currentTimeMillis();
+ }
+
static final String SONAR_CLUSTER_MASTER = "sonar.cluster.master";
static final String PATH_LOGS_KEY = "sonar.path.logs";