aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-main/src/main/java/org/sonar/application/es/EsSettings.java4
-rw-r--r--server/sonar-main/src/test/java/org/sonar/application/es/EsSettingsTest.java5
2 files changed, 6 insertions, 3 deletions
diff --git a/server/sonar-main/src/main/java/org/sonar/application/es/EsSettings.java b/server/sonar-main/src/main/java/org/sonar/application/es/EsSettings.java
index 51323964cae..dc3b606d1c4 100644
--- a/server/sonar-main/src/main/java/org/sonar/application/es/EsSettings.java
+++ b/server/sonar-main/src/main/java/org/sonar/application/es/EsSettings.java
@@ -108,7 +108,9 @@ public class EsSettings {
int searchPort = Integer.parseInt(props.nonNullValue(SEARCH_PORT.getKey()));
builder.put(ES_HTTP_HOST_KEY, searchHost.getHostAddress());
builder.put(ES_HTTP_PORT_KEY, valueOf(searchPort));
- builder.put(ES_NETWORK_HOST_KEY, valueOf(searchHost.getHostAddress()));
+ builder.put(ES_NETWORK_HOST_KEY, searchHost.getHostAddress());
+ builder.put("discovery.seed_hosts", searchHost.getHostAddress());
+ builder.put("cluster.initial_master_nodes", searchHost.getHostAddress());
int transportPort = Integer.parseInt(props.nonNullValue(ES_PORT.getKey()));
diff --git a/server/sonar-main/src/test/java/org/sonar/application/es/EsSettingsTest.java b/server/sonar-main/src/test/java/org/sonar/application/es/EsSettingsTest.java
index f3722d1332a..af87c10b721 100644
--- a/server/sonar-main/src/test/java/org/sonar/application/es/EsSettingsTest.java
+++ b/server/sonar-main/src/test/java/org/sonar/application/es/EsSettingsTest.java
@@ -150,14 +150,15 @@ public class EsSettingsTest {
.containsEntry("http.host", "127.0.0.1")
// no cluster, but cluster and node names are set though
.containsEntry("cluster.name", "sonarqube")
- .containsEntry("node.name", "sonarqube");
+ .containsEntry("node.name", "sonarqube")
+ .containsEntry("discovery.seed_hosts", "127.0.0.1")
+ .containsEntry("cluster.initial_master_nodes", "127.0.0.1");
assertThat(generated.get("path.data")).isNotNull();
assertThat(generated.get("path.logs")).isNotNull();
assertThat(generated.get("path.home")).isNull();
assertThat(generated.get("path.conf")).isNull();
- assertThat(generated.get("discovery.seed_hosts")).isNull();
assertThat(generated)
.containsEntry("discovery.initial_state_timeout", "30s")
.containsEntry("action.auto_create_index", "false");