Skip to content

Apache Lucene open-source search software

SOLR-9386: Move default clientPort specification to before calling QuorumPeerConfig.parseProperties(), which requires that clientPort be specified.

Steve Rowe8c11f81a9505
diff --git a/solr/core/src/java/org/apache/solr/cloud/SolrZkServer.java b/solr/core/src/java/org/apache/solr/cloud/SolrZkServer.java
index 9c2016fe766..418a5f0b784 100644
--- a/solr/core/src/java/org/apache/solr/cloud/SolrZkServer.java
+++ b/solr/core/src/java/org/apache/solr/cloud/SolrZkServer.java
@@ -85,10 +85,10 @@ public class SolrZkServer {
try {
props = SolrZkServerProps.getProperties(confHome + '/' + "zoo.cfg");
SolrZkServerProps.injectServers(props, zkRun, zkHost);
- zkProps.parseProperties(props);
- if (zkProps.getClientPortAddress() == null) {
- zkProps.setClientPort(solrPort + 1000);
+ if (props.getProperty("clientPort") == null) {
+ props.setProperty("clientPort", Integer.toString(solrPort + 1000));
}
+ zkProps.parseProperties(props);
} catch (QuorumPeerConfig.ConfigException | IOException e) {
if (zkRun != null)
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);