title: Run Multiple Solr instances in SolrCloud with three ZooKeeper server
body: <p>Using this fantastic GIST of Kalharbi at <a href="https://gist.github.com/kalharbi/fd29661b9926eb087c45" rel="nofollow">https://gist.github.com/kalharbi/fd29661b9926eb087c45</a> , I have configured <strong>SolrCloud</strong> on my localhost with three <strong>ZooKeeper</strong> server on port <strong>2181</strong>, <strong>2182</strong> &amp; <strong>2183</strong> where their roles are follower, follower, &amp; Leader respectively.</p>
  
  <p>I have uploaded two different configurations namely <strong>tr_config &amp; rp_config</strong> to ZooKeeper and create two collections using below commands</p>
  
  <p>My config folder contains some files like schema.xml,solrconfig.xml etc,at</p>
  
  <pre><code>     -/opt/solr/server/solr/configsets/tr_config
       -/opt/solr/server/solr/configsets/rp_config
  </code></pre>
  
  <p><strong>Upload config To ZooKeeper</strong>:</p>
  
  <pre><code>./server/scripts/cloud-scripts/zkcli.sh -cmd upconfig -zkhost 127.0.0.1:2181 -confdir ./server/solr/configsets/tr_config/conf/ -confname tr_config
  
  ./server/scripts/cloud-scripts/zkcli.sh -cmd upconfig -zkhost 127.0.0.1:2181 -confdir ./server/solr/configsets/rp_config/conf/ -confname rp_config
  </code></pre>
  
  <p><strong>Create Collections</strong>:</p>
  
  <pre><code>curl 'http://localhost:8983/solr/admin/collections?action=CREATE&amp;name=transactions&amp;numShards=2&amp;replicationFactor=1&amp;collection.configName=tr_config'
  
  curl 'http://localhost:8983/solr/admin/collections?action=CREATE&amp;name=properties&amp;numShards=2&amp;replicationFactor=1&amp;collection.configName=rp_config'
  </code></pre>
  
  <p>It works properly but then I have changed the <strong>solrconfig.xml</strong> on properties collection and update configuration again to ZooKeeper server,then it showing <strong>lockType.native</strong> issue on solr initialization, so then I have set <strong>lockType:none</strong> on <strong>solrconfig.xml</strong>. and it works again. but when I run all solr instances on different ports like 8983, 8984 &amp; 8985  using command</p>
  
  <pre><code>$ ./bin/solr start -c -p 8983 -z 127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183
  $ ./bin/solr start -c -p 8984 -z 127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183
  $ ./bin/solr start -c -p 8985 -z 127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183
  </code></pre>
  
  <p>It shows   </p>
  
  <blockquote>
    <p>no servers hosting shard: shard1</p>
  </blockquote>
  
  <p>but If I stop the other solr instances on 8984 and 8985 port and <strong>restart</strong> 8983 then all my docs are queryable. again if I start any of the 8984 or 8985 solr instance, 8983 instance again non queryable. </p>
  
  <blockquote>
    <p>The problem may be the data indexing directory are same for all three
    solr instances, but I don't know how to configure it differently for
    every other solr collections. So experts give some light on my below
    problems.</p>
  </blockquote>
  
  <ol>
  <li><p>What is the problem ? why not able to run three instances while I am
  updating the configuration on ZooKeeper.?</p></li>
  <li><p>How can I change the maxShardsPerNode ?</p></li>
  </ol>
  
  <p>Thanks in Advance</p>