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

This commit is contained in:
Steve Rowe 2017-05-01 10:26:41 -04:00
parent b705217bec
commit 8c11f81a95
1 changed files with 3 additions and 3 deletions

View File

@ -85,10 +85,10 @@ public class SolrZkServer {
try { try {
props = SolrZkServerProps.getProperties(confHome + '/' + "zoo.cfg"); props = SolrZkServerProps.getProperties(confHome + '/' + "zoo.cfg");
SolrZkServerProps.injectServers(props, zkRun, zkHost); SolrZkServerProps.injectServers(props, zkRun, zkHost);
zkProps.parseProperties(props); if (props.getProperty("clientPort") == null) {
if (zkProps.getClientPortAddress() == null) { props.setProperty("clientPort", Integer.toString(solrPort + 1000));
zkProps.setClientPort(solrPort + 1000);
} }
zkProps.parseProperties(props);
} catch (QuorumPeerConfig.ConfigException | IOException e) { } catch (QuorumPeerConfig.ConfigException | IOException e) {
if (zkRun != null) if (zkRun != null)
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e); throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);