Well, how brave do you want to be ;)? There's no great magic to the Zookeeper nodes here. If you do everything just right you could create one manually. By that I mean you could "hand edit" the znode with the Zookeeper commands, you'd have to dig for the exact commands.... You _may_ be able to use the ADDREPLICA command, assuming that the shard information is still in the ZK node. I haven't tried this however.
The first thing I'd do is see what's up with the replicas not coming up. What does the Solr log show? There must be some info there. And, assuming you still have a data directory there, then your docs _may_ be intact. you may be able to simply move them to some other Solr instance (actually, the entire collectionX_shardY_replicaZ and bounce the Solr server there. I don't _know_ that'll work, but what you'd see is the node in Zookeeper magically change the IP address of the replicas in question. All that said, if the node is somehow permanently gone, you have to re-index anyway to get the data back so recreating the collection would be less fooling around. Best, Erick On Wed, Jun 8, 2016 at 2:40 AM, Henrik Brautaset Aronsen <hen...@synth.no> wrote: > Hi. > > We have a SolrCloud setup with 20 shards, each with only 1 replica, served > on 8 servers. > > After a server went down we are left with 16 shards, which means that some > of the compositeId hash ranges aren't hosted by any cores. Somehow the > shards/cores didn't come back after the server came up again. I can see > the server in /live_nodes. > > But all is not bad: The data in the collection is volatile with a TTS of 30 > minutes, and we have a failover in place that tries a new random > compositeId whenever an "add" operation fails. > > My question is: Is it possible to re-create the missing shards or do I have > to delete and create the collection from scratch? > > I know which hash ranges are are missing, but the CREATESHARD [1] API call > doesn't support shards with the 'compositeId' router. And I cannot use > SPLITSHARD [2] since it only divides the original shard's hash. > > Best regards, > Henrik > > > [1] > https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api8 > [2] > https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api3