diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkController.java b/solr/core/src/java/org/apache/solr/cloud/ZkController.java index faa0b18fc46..cf7b57e17c3 100644 --- a/solr/core/src/java/org/apache/solr/cloud/ZkController.java +++ b/solr/core/src/java/org/apache/solr/cloud/ZkController.java @@ -225,6 +225,8 @@ public final class ZkController { this.hostName = normalizeHostName(cloudConfig.getHost()); this.nodeName = generateNodeName(this.hostName, Integer.toString(this.localHostPort), localHostContext); + MDC.put(NODE_NAME_PROP, nodeName); + this.leaderVoteWait = cloudConfig.getLeaderVoteWait(); this.leaderConflictResolveWait = cloudConfig.getLeaderConflictResolveWait(); diff --git a/solr/core/src/java/org/apache/solr/core/CoreContainer.java b/solr/core/src/java/org/apache/solr/core/CoreContainer.java index 8cc5d7a6dad..baf9f6a6107 100644 --- a/solr/core/src/java/org/apache/solr/core/CoreContainer.java +++ b/solr/core/src/java/org/apache/solr/core/CoreContainer.java @@ -246,9 +246,6 @@ public class CoreContainer { log.info("Node Name: " + hostName); zkSys.initZooKeeper(this, solrHome, cfg.getCloudConfig()); - if (isZooKeeperAware()) { - MDC.put(NODE_NAME_PROP, getZkController().getNodeName()); - } collectionsHandler = createHandler(cfg.getCollectionsHandlerClass(), CollectionsHandler.class); containerHandlers.put(COLLECTIONS_HANDLER_PATH, collectionsHandler);