title: Solr Cloud : no servers hosting shard
body: <p>We have a cluster of standalone Solr cores (Solr 4.3) for which we had built some custom plugins. I'm now trying to prototype converting the cluster to a Solr Cloud cluster. This is how I am trying to deploy the cores (in 4.7.2).</p>
  
  <ol>
  <li><p>Start solr with zookeeper embedded. </p>
  
  <p>java -DzkRun -Djetty.port=8985 -jar start.jar</p></li>
  <li><p>upload a config into Zookeeper (same config as the standalone cores)</p>
  
  <p>zkcli.bat -zkhost localhost:9985 -cmd upconfig -confdir myconfig -confname myconfig</p></li>
  <li><p>Create a new collection (mycollection) of 2 shards using the Collections API 
  <a href="http://localhost:8985/solr/admin/collections?action=CREATE&amp;name=mycollection&amp;numShards=2&amp;replicationFactor=1&amp;maxShardsPerNode=2&amp;collection.configName=myconfig" rel="nofollow">http://localhost:8985/solr/admin/collections?action=CREATE&amp;name=mycollection&amp;numShards=2&amp;replicationFactor=1&amp;maxShardsPerNode=2&amp;collection.configName=myconfig</a></p></li>
  </ol>
  
  <p>So  at this point I have two shards under my solr directory with the appropriate core.properties</p>
  
  <p>But when I go to <a href="http://localhost:8985/solr/#/~cloud" rel="nofollow">http://localhost:8985/solr/#/~cloud</a>, I see that the two shards'  status is "Down" when they are supposed to be active by default.</p>
  
  <p>And when I try to index documents in them using SolrJ (via CloudSolrServer API) , I get the error "No live SolrServers available to handle this request". I restarted Solr but same issue.</p>
  
  <pre><code>private CloudSolrServer cloudSolr;
      cloudSolr = new CloudSolrServer(zkHOST);
      cloudSolr.setZkClientTimeout(zkClientTimeout);
      cloudSolr.setDefaultCollection(collectionName);
      cloudSolr.connect();
      cloudSolr.add(doc)
  </code></pre>
  
  <p>What am I doing wrong? I did a lot of digging around and saw an old Jira bug saying that Solr Cloud shards won't be active until there are some documents in the index. If that is the reason, that's kind of like a catch-22 isn't it? </p>
  
  <p>So anyways, I also tried adding some test documents manually and committed to see if things improved. Now on the shard statistics page, it correctly gives me the Numdocs count but when I try to query it says "no servers hosting shard".  I next tried passing in shards.tolerant=true as a query parameter and search, but no cigar. It says 0 documents found.</p>
  
  <p>Any help would be appreciated. My main objective is to rebuilt the old standalone cores using SolrCloud and test to see if our custom requesthandlers still work as expected. And at this point, I can't index documents inside of the 4.7 Solr Cloud collection I have created.</p>
  
  <p>Thanks and Regards</p>