aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@searchbox.com>2014-08-05 15:40:46 +0200
committerStephane Gamard <stephane.gamard@searchbox.com>2014-08-06 09:10:25 +0200
commit6fda70f66f0e3b20ef8dc7ff3129dd4dde21f73d (patch)
treec3db525b976e87e66caa13d9d703198b6f10aca1 /server
parentc5578ed7b362b8efad4274b48763eede63d95d8f (diff)
downloadsonarqube-6fda70f66f0e3b20ef8dc7ff3129dd4dde21f73d.tar.gz
sonarqube-6fda70f66f0e3b20ef8dc7ff3129dd4dde21f73d.zip
SONAR-5483 - Only allow http console for in-memory ES for MediumTests
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/search/ESNode.java23
1 files changed, 9 insertions, 14 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/search/ESNode.java b/server/sonar-server/src/main/java/org/sonar/server/search/ESNode.java
index 2e06e7b9cee..fc3f54537bd 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/search/ESNode.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/search/ESNode.java
@@ -136,7 +136,6 @@ public class ESNode implements Startable {
initMemoryES(esSettings);
}
- initRestConsole(esSettings);
initNetwork(esSettings);
node = NodeBuilder.nodeBuilder()
@@ -182,7 +181,15 @@ public class ESNode implements Startable {
.put("path.logs", esLogDir().getAbsolutePath());
-
+ int httpPort = settings.getInt(IndexProperties.HTTP_PORT);
+ if (httpPort > 0) {
+ LOG.warn("Elasticsearch HTTP console enabled on port {}. Only for debugging purpose.", httpPort);
+ builder.put(HTTP_ENABLED, true);
+ builder.put("http.host", "127.0.0.1");
+ builder.put("http.port", httpPort);
+ } else {
+ builder.put(HTTP_ENABLED, false);
+ }
}
private void addIndexTemplates() {
@@ -255,18 +262,6 @@ public class ESNode implements Startable {
esSettings.put("network.bind_host", "127.0.0.1");
}
- private void initRestConsole(ImmutableSettings.Builder esSettings) {
- int httpPort = settings.getInt(IndexProperties.HTTP_PORT);
- if (httpPort > 0) {
- LOG.warn("Elasticsearch HTTP console enabled on port {}. Only for debugging purpose.", httpPort);
- esSettings.put(HTTP_ENABLED, true);
- esSettings.put("http.host", "127.0.0.1");
- esSettings.put("http.port", httpPort);
- } else {
- esSettings.put(HTTP_ENABLED, false);
- }
- }
-
private File esHomeDir() {
if (!settings.hasKey("sonar.path.home")) {
throw new IllegalStateException("property 'sonar.path.home' is required");