diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2020-01-10 09:07:39 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-11-05 20:06:21 +0000 |
commit | 6390f55dcf651f5c9c7a0fb1e54a2ec8594f8940 (patch) | |
tree | 8894072746ca13e5fb1952dbfc39249a8dcfbb9c /server/sonar-main | |
parent | 8bcd89e733ce3dca9fef142a0db047a8f8dfd0ac (diff) | |
download | sonarqube-6390f55dcf651f5c9c7a0fb1e54a2ec8594f8940.tar.gz sonarqube-6390f55dcf651f5c9c7a0fb1e54a2ec8594f8940.zip |
SONAR-12686 replace deprecated setting transport.tcp.port by transport.port
Diffstat (limited to 'server/sonar-main')
3 files changed, 5 insertions, 3 deletions
diff --git a/server/sonar-main/src/main/java/org/sonar/application/command/CommandFactoryImpl.java b/server/sonar-main/src/main/java/org/sonar/application/command/CommandFactoryImpl.java index 66c2f02672d..37cd0c6c31e 100644 --- a/server/sonar-main/src/main/java/org/sonar/application/command/CommandFactoryImpl.java +++ b/server/sonar-main/src/main/java/org/sonar/application/command/CommandFactoryImpl.java @@ -145,7 +145,7 @@ public class CommandFactoryImpl implements CommandFactory { .setEsYmlSettings(new EsYmlSettings(settingsMap)) .setClusterName(settingsMap.get("cluster.name")) .setHost(settingsMap.get("network.host")) - .setPort(Integer.parseInt(settingsMap.get("transport.tcp.port"))); + .setPort(Integer.parseInt(settingsMap.get("transport.port"))); return esInstallation; } 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 78a20cf6d6d..a852fdf4efc 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 @@ -91,7 +91,9 @@ public class EsSettings { int port = Integer.parseInt(props.nonNullValue(SEARCH_PORT.getKey())); LOGGER.info("Elasticsearch listening on {}:{}", host, port); - builder.put("transport.tcp.port", valueOf(port)); + // FIXME no need to open TCP port unless running DCE + // TCP is used by main process to check ES is up => probably has to use HTTP now + builder.put("transport.port", valueOf(port)); builder.put("transport.host", valueOf(host.getHostAddress())); builder.put("network.host", valueOf(host.getHostAddress())); 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 275712e53d4..cfc7800d52e 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 @@ -138,7 +138,7 @@ public class EsSettingsTest { EsSettings esSettings = new EsSettings(props, new EsInstallation(props), system); Map<String, String> generated = esSettings.build(); - assertThat(generated.get("transport.tcp.port")).isEqualTo("1234"); + assertThat(generated.get("transport.port")).isEqualTo("1234"); assertThat(generated.get("transport.host")).isEqualTo("127.0.0.1"); // no cluster, but cluster and node names are set though |