Support Questions

Find answers, ask questions, and share your expertise

Move Solr server from one host to another using Cloudera Parcels

avatar
Rising Star

I would like to move a Solr server from one host to another host that has a lot more memory using Cloudera. I am using CDH 5.2 with CM 5.2. My questions: Is it possible to move the Solr server from one host to another? What about the indexes, how are they moved? Any advice would be appreciated. 

1 ACCEPTED SOLUTION

avatar
Cloudera Employee

Hi,

 

If you don't have data saved in Solr, then moving solr servers is very staright forward by adding a new solr server role on the new host using Cloudera Manager.

 

If you already have data saved in solr, then in addition to the above step you also need to move the solr cores of current host to the new host. And here are the steps to move the core.

 

Instructions

The supported procedure to migrate a replica from one server to another is as follows: Migrating from:cdh5-2.cloudera.local
Collection: students
Replica name: students_shard1_replica2
Migrating to:cdh5-3.cloudera.local
Collection: students
Replica name: students_shard1_replica3
  1. On the target server, from a command line, add the Core with the following API call (Core Admin UI is not recommended):

    curl http://cdh5-3.cloudera.local:8983/solr/admin/cores?action=CREATE&name=students_shard1_replica3&colle...

    Note: Name should be a new replica name, but should conform to collection_shardn_replican for consistency. If two replicas exist in the current shard, use replica3 in the name to avoid conflicts.

  2. Verify that the core is created, and moves from recovery state to UP.

  3. On the old node, from a command line, run the following UNLOAD command (again, Core Admin UI is not recommended), which will remove the core.properties in /var/lib/solr on the old node:

    curl http://cdh5-2.cloudera.local:8983/solr/admin/cores?action=UNLOAD&core=students_shard1_replica2&delet...

    Note: If the old node is down or Solr unavailable, the above command will fail. Manually remove the core.properties under /var/lib/solr/collection_shardn_replican so the node does not attempt to register that replica when it starts.

  4. Verify in the CLOUD UI that the old replica has been removed.

Important: To speed recovery time, suspend any incoming ingestion while the new replica is doing a full replication from the leader. NRT ingestion can then be turned back on.

 

After the above steps, you can remove the solr server from the first host if required (use Cloudera Manager to handle this)

View solution in original post

11 REPLIES 11

avatar

It appears you are using the replica name for the shard value.  

 

Try this instead:

http://solrserver1:8983/solr/admin/collections?action=ADDREPLICA&collection=mycollection&shard=shard1&node=solrserver2:8983_solr

avatar
Contributor

Thanks . That got me a bit closer.

 

I discovered that there was no core created on solrserver2, which i just did and restarted  both servers.

 

now i am getting Node: solrserver2:8983_solr is not live !

 

but i see it started in the manager , and no logs either. What am I missing !!

 

Your help probably saved couple days of reading and frustration !