Migrating Solr Replicas
When you replace a host, migrating replicas on that host to the new host, instead of depending on failure recovery, can help ensure optimal performance.
- For adding replicas, the node parameter ensures the new replica is created on the intended host. If no host is specified, Solr selects a host with relatively fewer replicas.
- For deleting replicas, the request is routed to the host that hosts the replica to be deleted.
Adding replicas can be resource intensive. For best results, add replicas when the system is not under heavy load. For example, do not add additional replicas when heavy indexing is occurring or when MapReduceIndexerTool jobs are running.
Cloudera recommends using API calls to create and unload cores. Do not use the Cloudera Manager Admin Console or the Solr Admin UI for these tasks.
- Host names:
- origin at the IP address 192.0.2.1.
- destination at the IP address 192.0.2.2.
- Collection name email
- The original replica email_shard1_replica2, which is on origin.
- The new replica email_shard1_replica3, which will be on destination.
To migrate a replica to a new host
- Create the new replica on destination server using the ADDREPLICA API:
- Verify that the replica creation succeeds and moves from recovery state to ACTIVE. You can check the replica status in the Cloud view, which can be found at a URL similar to: http://destination.example.com:8983/solr/#/~cloud.
- Use the CLUSTERSTATUS API to retrieve information about the cluster, including current cluster status:
Review the returned information to find the correct replica to remove.
- Delete the old replica on origin server using the DELETEREPLICA API:
The DELTEREPLICA call removes the datadir.