On 11/10/2014 12:00 AM, elmerfudd wrote:
> What is the proper way to backup Solr while running, in the index level and
> in the node level.
> How do you restore it afterwards ?

One way to back up is to use the backup feature of the replication
handler.  Note that this actually copies the files, so this can be very
slow if the index is large.

https://cwiki.apache.org/confluence/display/solr/Backing+Up

Restoring involves stopping Solr, deleting the current index directory
(and tlog directory if it exists), copying the backed up index directory
(will be as slow as making the backup was in the first place) into the
original location, and starting Solr back up.  This approach will work
on ANY operating system.

If you're on UNIX or a clone like Linux, there is an alternate backup
method that works a lot faster, using hardlinks.  If you make a hardlink
copy of the index directory (the copy must be on the same filesystem),
it will complete instantly and take up zero additional disk space, at
least until you update the original index.

Restoring it would similar to what I described above, but instead of a
traditional copy, you'd do another hardlink copy after deleting the
current index.  That would also complete instantly.

Due to the way that Lucene creates index files, the hardlink copies are
guaranteed to never be corrupted by ongoing index operations in the
original directory.

Thanks,
Shawn

Reply via email to