So here's what I do (not saying this is the best method, but
definitely works great albeit with a little work on my part)
The replication handler (which must be enabled for Solr cloud)
supports a backup command, e.g.
From what I've heard, this is the "safe" way to backup an index in Solr.
Every X minutes, I send a hard commit and then send this "backup"
command to only 1 replica per shard as you don't need multiple
replicas of the same shard backing up the same thing. I chose to send
this to the leaders but that is definitely not required.
The actual backup runs in the background asynchronously, so the
command returns to your client immediately. So there's not a good way
to know when the backup is done ... so I "poll" the replication
handler's details action, e.g. .../replication?command=details, which
will return a completed on date when your backup is done. So my
backup tool simply waits until all shards report as being completed.
Then I move the backup offsite, which for us is S3.
Incidentally, I wrote my backup driver in Java b/c the SolrJ library
gives you access to all the cluster state information you need to pick
one replica per shard to start the backup on, e.g. something like
private static final Map<String,String>
getShardLeaders(CloudSolrServer solr, String collection) throws
Map<String,String> leaders = new TreeMap<String,String>();
ZkStateReader zkStateReader = solr.getZkStateReader();
for (Slice slice :
zkStateReader.getLeaderUrl(collection, slice.getName(), ZK_TIMEOUT));
On Thu, Apr 25, 2013 at 3:22 PM, Furkan KAMACI wrote:
I use SolrCloud. Let's assume that I want to move all indexes from one
place to another. There maybe two reasons for that:
First one is that: I will close all my system and I will use new machines
with previous indexes (if it is a must they may have same network topology)
at anywhere else after some time later.
Second one is that: I know that SolrCloud handles failures but I will back
up my indexes for a disaster event.
How can I back up my indexes? I know that I can start up new nodes and I
can close the old ones so I can move my indexes to other machines. However
how can I do such kind of backup (should I just copy data folder of Solr
nodes and put them to new Solr nodes after I change Zookeeper
What folks do?