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 625c005f11e..2da89d965d6 100644 --- a/solr/core/src/java/org/apache/solr/cloud/SolrZkServer.java +++ b/solr/core/src/java/org/apache/solr/cloud/SolrZkServer.java @@ -45,17 +45,21 @@ public class SolrZkServer { String zkRun; String zkHost; - String solrHome; + String solrPort; Properties props; SolrZkServerProps zkProps; private Thread zkThread; // the thread running a zookeeper server, only if zkRun is set - public SolrZkServer(String zkRun, String zkHost, String solrHome, String solrPort) { + private String dataHome; + private String confHome; + + public SolrZkServer(String zkRun, String zkHost, String dataHome, String confHome, String solrPort) { this.zkRun = zkRun; this.zkHost = zkHost; - this.solrHome = solrHome; + this.dataHome = dataHome; + this.confHome = confHome; this.solrPort = solrPort; } @@ -74,13 +78,13 @@ public class SolrZkServer { zkProps = new SolrZkServerProps(); // set default data dir // TODO: use something based on IP+port??? support ensemble all from same solr home? - zkProps.setDataDir(solrHome + '/' + "zoo_data"); + zkProps.setDataDir(dataHome); zkProps.zkRun = zkRun; zkProps.solrPort = solrPort; } try { - props = SolrZkServerProps.getProperties(solrHome + '/' + "zoo.cfg"); + props = SolrZkServerProps.getProperties(confHome + '/' + "zoo.cfg"); SolrZkServerProps.injectServers(props, zkRun, zkHost); zkProps.parseProperties(props); if (zkProps.getClientPortAddress() == null) { 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 17119878193..41ae1a66149 100644 --- a/solr/core/src/java/org/apache/solr/cloud/ZkController.java +++ b/solr/core/src/java/org/apache/solr/cloud/ZkController.java @@ -130,7 +130,7 @@ public final class ZkController { } SolrZkServer zkServer = null; if (solrHome != null) { - zkServer = new SolrZkServer("true", null, solrHome, solrPort); + zkServer = new SolrZkServer("true", null, solrHome + "/zoo_data", solrHome, solrPort); zkServer.parseConfig(); zkServer.start(); } 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 43af4afca5b..86911ba9f2c 100644 --- a/solr/core/src/java/org/apache/solr/core/CoreContainer.java +++ b/solr/core/src/java/org/apache/solr/core/CoreContainer.java @@ -173,8 +173,9 @@ public class CoreContainer System.setProperty("zookeeper.jmx.log4j.disable", "true"); if (zkRun != null) { - String zkDataDir = System.getProperty("zkServerDataDir", solrHome); - zkServer = new SolrZkServer(zkRun, zookeeperHost, zkDataDir, hostPort); + String zkDataHome = System.getProperty("zkServerDataDir", solrHome + "zoo_data"); + String zkConfHome = System.getProperty("zkServerConfDir", solrHome); + zkServer = new SolrZkServer(zkRun, zookeeperHost, zkDataHome, zkConfHome, hostPort); zkServer.parseConfig(); zkServer.start();