Migrating Solr Replicas

Migrating replicas is valuable in cases such as when a node is to be replaced. In such a case, migrating any collections on that node to a new node can help ensure optimal performance by deliberately migrating the replica rather than depending on failure recovery.

To migrate a replica to a new node

This procedure uses the following sample names:
  • Node names origin and destination.
  • Collection name email
  • Replica names email_shard1_replica2, which is on origin and email_shard1_replica3, which will be on destination.

Cloudera recommends using API calls for creating and unloading cores. Do not use the Cloudera Manager Admin Console for these tasks.

  1. Use curl to add the new collection on the destination server using the CREATE API. For example:
    curl 'http://destination.example.com:8983/solr/admin/cores?action=CREATE&name=email_shard1_replica3&collection=email&shard=shard1'
  2. In the Cloudera Manager Admin Console, verify core creation succeeds, and that the core moves from recovery state to UP.
  3. Use curl to remove the core.properties from /var/lib/solr on the origin node using the UNLOAD API. For example:
    curl 'http://origin.example.com:8983/solr/admin/cores?action=UNLOAD&core=email_shard1_replica2&deleteInstanceDir=yes'
  4. In the Cloudera Manager Admin Console, verify that the old replica has been removed.