Reputation: 41
We have started working on our current search from master/slave to SolrCloud. I have couple of questions related with expanding the nodes dynamically. Please help.
What is best way to migrate an existing shard to new node? is it just a creating a core on new node manually as below or there is another way?
localhost:8888/solr/admin/cores?action=CREATE&name=testcollection_shard1_replica1&collection=testcollection&shard=shard1&collection.configName=collection1
How to create new replica dynamically? is just creating a new core as below or there is another way?
localhost:8888/solr/admin/cores?action=CREATE&name=testcollection_shard1_replica2&collection=testcollection&shard=shard1&collection.configName=collection1
How to add a brand new shard to collection dynamically? is it just creating a new core with new shard name on a new node as below? will on newly created shard documents be distributed automatically? or this is not the right way and we should use shard splitting?
localhost:8888/solr/admin/cores?action=CREATE&name=testcollection_shard2_replica1&collection=testcollection&shard=shard2&collection.configName=collection1
Thank you so much for help!!
-Umesh
Upvotes: 4
Views: 2494
Reputation: 1394
To move an existing shard to new node, just add a new replica on the new node and wait until the replication is completed. After that, you can shutdown the old node or remove it from the cluster using the UNLOAD command.
To create a new replica dynamically, the collection command you have mentionned is the only way.
To create a new shard, the only thing you can do is to split an existing shard. Just mind that your collection is not balanced. The splitted shard will have the hash range divided but all other unsplit shards still have the same hash range as before.
Upvotes: 3