You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Luca Cavanna <ca...@gmail.com> on 2011/11/11 11:13:24 UTC

Backup multiple cores through the ReplicationHandler

Hello,
I would like to make daily backups using the Solr ReplicationHandler. I
work with multiple cores and I need to backup all of them, so I'm writing a
java main to dinamically retrieve the core list through SolrJ. Then I run
the backup command for each core.
After, I need to move the backups to another location and do some more
operations with those files. I found out the backup command is
asynchronous, and of course it takes some time to make backup of large
indexes. Basically, I'm looking for a way to know when a core backup has
been completed, but I haven't found one yet.

I had a look at the code and it wouldn't be hard adding a flag to choose
whether the backup command has to be executed asynchronously or not.
Anyway, I don't necessarily need to invoke the backup via a web command, so
I wonder if there's a better way to proceed to achieve my goal.

It's also a bit annoying running the same command for each core, but I
haven't found a faster way to backup all cores.
Furthermore, the directory tree for multiple core backups isn't so handy in
my case, since the snapshot directory is repeated for each core, while I
would prefer to have one top-level snapshot directory. With this structure,
I could basically restore all backups with a simple copy command.

Current tree:

backup
|_ core1
   |_ snapshot.2011...
|_ core2
   |_ snapshot.2011...
|_ core3
   |_ snapshot.2011...


Proposed tree:

backup
|_ snapshot.2011...
   |_ core1
   |_ core2
   |_ core3


I'm willing to contribute on this. Could you please give me some feedbacks
to point me in the right direction?

Thanks in advance