0
votes

I'm new to SolrCloud (and Solr).

I need your help understanding collection shard and replicas.

I have two SolrCLoud instances running on two different server. I have a collection, mycol, with two shards. Each solrcloud host a shard. Because I'm running two nodes, I am thinking to add redundancy. I have some questions about it: First Way: add a new one core on each SolrCloud, assign it to mycol shard2 on SolrCloud hosting mycol shard1 and assign it to mycol shard1 on SolrCloud hosting mycol shard2. New shards will become replica and on each node I will have the complete collection in the case of hardware failure.

Second way: add two SOlrcCLoud instances on two more servers. They will become replicas automatically.

Third way: add two SolrCloud instances, now for each existing server. They will become replicas automatically.

I'm driving me crazy to understand what is the correct way.

Can you help me?

Thank you Regards Giova

1

1 Answers

0
votes

It's a bit hard to discect what you are looking for based on your question, however the standard practice is to deploy two or more SolrCloud nodes. Make sure they can talk to each other and zookeeper. Once that is set-up, you can configure your collections with numShards and ReplicationFactor parameter. These parameter will determine how many shards are created and how many replicas will be created for each shard.Shards are used to break up the collection into smaller chucks, shards don't provide any redundancy. Shard replicas are exact copies of your shards, this will actually provide redundancy.

Once you fire off this command to any of the replicas in the SolrCloud cluster, your collection will be created. The replicas are created on the second server to provide redundancy if the first one goes down. At this point, you should be able to query any replica and SolrCloud will automatically route the query internally and provide results.