From 8282e6a7e3d1568637e734c957013fba14bc5aff Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Fri, 27 Apr 2018 11:21:12 +0200 Subject: [PATCH] SONAR-10604 ignore sonar.cluster.node.port on search nodes --- .../java/org/sonar/application/config/ClusterSettings.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/sonar-main/src/main/java/org/sonar/application/config/ClusterSettings.java b/server/sonar-main/src/main/java/org/sonar/application/config/ClusterSettings.java index ddd71cda2fb..1aafe77daa1 100644 --- a/server/sonar-main/src/main/java/org/sonar/application/config/ClusterSettings.java +++ b/server/sonar-main/src/main/java/org/sonar/application/config/ClusterSettings.java @@ -26,6 +26,7 @@ import java.util.Arrays; import java.util.List; import java.util.function.Consumer; import org.apache.commons.lang.StringUtils; +import org.slf4j.LoggerFactory; import org.sonar.process.MessageException; import org.sonar.process.NetworkUtils; import org.sonar.process.ProcessId; @@ -42,6 +43,7 @@ import static org.sonar.process.ProcessProperties.Property.AUTH_JWT_SECRET; import static org.sonar.process.ProcessProperties.Property.CLUSTER_ENABLED; import static org.sonar.process.ProcessProperties.Property.CLUSTER_HOSTS; import static org.sonar.process.ProcessProperties.Property.CLUSTER_NODE_HOST; +import static org.sonar.process.ProcessProperties.Property.CLUSTER_NODE_PORT; import static org.sonar.process.ProcessProperties.Property.CLUSTER_NODE_TYPE; import static org.sonar.process.ProcessProperties.Property.CLUSTER_SEARCH_HOSTS; import static org.sonar.process.ProcessProperties.Property.CLUSTER_WEB_STARTUP_LEADER; @@ -78,6 +80,9 @@ public class ClusterSettings implements Consumer { case SEARCH: requireValue(props, SEARCH_HOST.getKey()); ensureLocalButNotLoopbackAddress(props, SEARCH_HOST.getKey()); + if (props.contains(CLUSTER_NODE_PORT.getKey())) { + LoggerFactory.getLogger(getClass()).warn("Property {} is ignored on search nodes since 7.2", CLUSTER_NODE_PORT.getKey()); + } break; default: throw new UnsupportedOperationException("Unknown value: " + nodeType); -- 2.39.5