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 Torsten Krah <tk...@fachschaft.imn.htwk-leipzig.de> on 2012/01/03 14:32:50 UTC

doing snapshot after optimize - rotation parameter?

Hi,

i am taking snapshots of my master index after optimize calls (run each
day once), to get a clean backup of the index.
Is there a parameter to tell the replication handler how many snapshots
to keep and the rest should be deleted? Or must i use a custom script
via cron?

regards

Torsten

Re: doing snapshot after optimize - rotation parameter?

Posted by Torsten Krah <tk...@fachschaft.imn.htwk-leipzig.de>.
Am Donnerstag, den 05.01.2012, 08:48 -0500 schrieb Erick Erickson:
> Have you looked at deletionPolicy and maxCommitsToKeep?

Hm, but that are deletion policy parameters for the "running" index, how
much commit points should be kept - the internal ones from lucene:

#####################################################
<!-- configure deletion policy here-->
    <deletionPolicy class="solr.SolrIndexDeletionPolicy">
      <!--  Store only the commits with optimize.Non optimized commits
will get deleted by lucene when
            the last IndexWriter/IndexReader using this commit point is
closed  -->
      <str name="keepOptimizedOnly">true</str>
      <!--Maximum no: of commit points stored . Older ones will be
cleaned when they go out of scope-->
      <str name="maxCommitsToKeep"></str>
      <!-- max age of a stored commit-->
      <str name="maxCommitAge"></str>
    </deletionPolicy>
#####################################################

A rotated snapshot is everytime out-of-scope - its like a backup,
maxCommitsToKeep would not make any sense here, right?
Reading this: https://issues.apache.org/jira/browse/SOLR-617 it sounds
like different use case.

Are there really meant to be used for rotation the snapshot directories,
reading the comments it does not sound to be what i am looking for, am i
right?

regards

Torsten

> 
> Best
> Erick
> 
> On Tue, Jan 3, 2012 at 8:32 AM, Torsten Krah
> <tk...@fachschaft.imn.htwk-leipzig.de> wrote:
> > Hi,
> >
> > i am taking snapshots of my master index after optimize calls (run each
> > day once), to get a clean backup of the index.
> > Is there a parameter to tell the replication handler how many snapshots
> > to keep and the rest should be deleted? Or must i use a custom script
> > via cron?
> >
> > regards
> >
> > Torsten


Re: doing snapshot after optimize - rotation parameter?

Posted by Erick Erickson <er...@gmail.com>.
Have you looked at deletionPolicy and maxCommitsToKeep?

Best
Erick

On Tue, Jan 3, 2012 at 8:32 AM, Torsten Krah
<tk...@fachschaft.imn.htwk-leipzig.de> wrote:
> Hi,
>
> i am taking snapshots of my master index after optimize calls (run each
> day once), to get a clean backup of the index.
> Is there a parameter to tell the replication handler how many snapshots
> to keep and the rest should be deleted? Or must i use a custom script
> via cron?
>
> regards
>
> Torsten

Re: doing snapshot after optimize - rotation parameter?

Posted by Chris Hostetter <ho...@fucit.org>.
: i am taking snapshots of my master index after optimize calls (run each

please define what you mean by "taking snapshots" -- the replication 
handler has no "snapshot" command that i know of.  Are you using the 
old "snapshooter" scripts from Solr 1.4 style replication, or are you 
doing something else outside of Solr?

: day once), to get a clean backup of the index.

If your goal is to create backups, use the "backup" command of the 
replication handler.

: Is there a parameter to tell the replication handler how many snapshots
: to keep and the rest should be deleted? Or must i use a custom script
: via cron?

As of Solr 3.5 the backup command supports a "numberToKeep" param...

https://wiki.apache.org/solr/SolrReplication#HTTP_API


-Hoss

Re: doing snapshot after optimize - rotation parameter?

Posted by Torsten Krah <tk...@fachschaft.imn.htwk-leipzig.de>.
To answer myself after looking at the code:

public static final String NUMBER_BACKUPS_TO_KEEP = "numberToKeep";

So 

<str name="numberToKeep">7</str>

should do it :-).

regards