You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Li Li <fa...@gmail.com> on 2010/07/12 08:17:45 UTC

how to save a snapshot of an index?

    When I add some docs by
post.jar(org.apache.solr.util.SimplePostTool), It commits after all
docs are added. It will call IndexWriter.commit(). And a new segment
will be added and sometimes it triggers segment merging. New index
files will be generated(frm, tii,tis, ....). Old segments will be
deleted after all references are closed(All the reader which open it).
    That's ok. But I want to backup a version of my index so that when
something wrong happen I can use it. I can write a script to backup
all the files in the index directory everyday. But it may happen that
when it's indexing, the script may backup wrong files. So it must
obtain the ***.lock file to make things right. Is there any built in
tools in solr for my need ? I just want to back up the index
periodly(such as 0 clock every day).

Re: how to save a snapshot of an index?

Posted by Peter Karich <pe...@yahoo.de>.
Hi Li Li,

If the changes are not that frequently just copy the data folder:
http://wiki.apache.org/solr/SolrOperationsTools

Or see this question + answer:
http://stackoverflow.com/questions/3083314/solr-incremental-backup-on-real-time-system-with-heavy-index

where those direct links could help:
http://wiki.apache.org/solr/CollectionDistribution (solr < 1.4)
http://wiki.apache.org/solr/SolrReplication (solr >= 1.4)

Regards,
Peter.

>     When I add some docs by
> post.jar(org.apache.solr.util.SimplePostTool), It commits after all
> docs are added. It will call IndexWriter.commit(). And a new segment
> will be added and sometimes it triggers segment merging. New index
> files will be generated(frm, tii,tis, ....). Old segments will be
> deleted after all references are closed(All the reader which open it).
>     That's ok. But I want to backup a version of my index so that when
> something wrong happen I can use it. I can write a script to backup
> all the files in the index directory everyday. But it may happen that
> when it's indexing, the script may backup wrong files. So it must
> obtain the ***.lock file to make things right. Is there any built in
> tools in solr for my need ? I just want to back up the index
> periodly(such as 0 clock every day).
>   


Re: how to save a snapshot of an index?

Posted by Ahmet Arslan <io...@yahoo.com>.
>     That's ok. But I want to backup a version of
> my index so that when
> something wrong happen I can use it. I can write a script
> to backup
> all the files in the index directory everyday. But it may
> happen that
> when it's indexing, the script may backup wrong files. So
> it must
> obtain the ***.lock file to make things right. Is there any
> built in
> tools in solr for my need ? I just want to back up the
> index periodly(such as 0 clock every day).

Under the bin directory there are some scripts for that purpose.
http://wiki.apache.org/solr/CollectionDistribution