You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Bonnet Jonathan <jo...@externe.bnpparibas.com> on 2013/12/06 11:04:19 UTC

Try to configure commitlog_archiving.properties

Hello,

  I try to configure commitlog_archiving.properties to take advantage of 
backup and restore at a point of time, but there is no ressources on 
internet for that. So i need some help.

  If I understand I have 4 parameters:

archive_command=

restore_command=

restore_directories=

restore_point_in_time=

  Forget for the moment the restore_point_in_time, should i put one command
only for the archive_command; my wish is to copy all the commitlogs on 
another directory:

restore_directories=/produits/cassandra/cassandra_data/archived_logs

archive_command=/bin/cp -
f /produits/cassandra/cassandra_commit/*.log /produits/cassandra/cassandra_
data/archived_logs

restore_command=/bin/cp -
f /produits/cassandra/cassandra_data/archived_logs/*.log /produits/cassandr
a/cassandra_commit

But it doesn't work when i restart the node which interest me, it doesn't 
copy anything.

Why, can you give me a good example and the good way to configure archive 
commit logs ? there's nothing on the net except Datastax Website.

Thanks for your answear.

Regards,

Bonnet Jonathan.


Re: Try to configure commitlog_archiving.properties

Posted by "Bonnet Jonathan." <jo...@externe.bnpparibas.com>.
Artur Kronenberg <artur.kronenberg <at> openmarket.com> writes:

> 
> It's been a while since I tried that but here are some things I can 
> think of:
> 
> * the .log.out seems wrong. Unless your cassandra commitlogs don't end 
> in .log.out. I tried this locally with your script and my commitlogs get 
> extracted to .log files for me.
> * I never tried the restore procedure on a cluster with multiple nodes. 
> I imagine if you have a quorum defined the replayed commitlog may be 
> ignored because the commitlog write operation is older then the deletion 
> in which case the latter will be returned (nothing in your case)
> 

Thanks to take time to answear Artur,

When you talkin' about quorum, you think about replication factor or
tuneable transaction quorum for consistency ?

I work on a multiple node cluster, but for this restore i use a keyspace
with no replication on the other node.



Regards,

Bonnet Jonathan.





Re: Try to configure commitlog_archiving.properties

Posted by Artur Kronenberg <ar...@openmarket.com>.
It's been a while since I tried that but here are some things I can 
think of:

* the .log.out seems wrong. Unless your cassandra commitlogs don't end 
in .log.out. I tried this locally with your script and my commitlogs get 
extracted to .log files for me.
* I never tried the restore procedure on a cluster with multiple nodes. 
I imagine if you have a quorum defined the replayed commitlog may be 
ignored because the commitlog write operation is older then the deletion 
in which case the latter will be returned (nothing in your case)

On 13/12/13 13:27, Bonnet Jonathan. wrote:
> Hello,
>
>    As i told you i began to explore restore operations, see my config for
> archive commit logs:
>
> archive_command=/bin/bash /produits/cassandra/scripts/cassandra-archive.sh
> %path %name
>
> restore_command=/bin/bash /produits/cassandra/scripts/cassandra-restore.sh
> %from %to
>
> restore_directories=/produits/cassandra/cassandra_data/archived_commit
>
> restore_point_in_time=2013:12:11 17:00:00
>
> My 2 scripts
>
> cassandra-archive.sh:
>
> bzip2 --best -k $1
> mv $1.bz2 /produits/cassandra/cassandra_data/archived_commit/$2.bz2
>
>
> cassandra-restore.sh:
> cp -f $1 $2
> bzip2 -d $2
>
>
>    
> For an example, at 2013:12:11 17:30:00 i had truncate a table which belong
> to a keyspace with no replication on one node, after that i made a nodetool
> flush. So when i restore to 2013:12:11 17:00:00 i expect to have my table
> bein fill up again.
>
> The node restart with this config correctly, i see my archive commit log
> come back to my commitlogdirectory, seems bizarre to me that these ones
> finish by *.out like CommitLog-3-1386927339271.log.out and not just .log.
> Everything is normal ?
>
> When i query my table now, this one is still empty. Finaly my restore
> doesn't work and i wonder why ?
>
> Do i have to make a restore on all nodes ? my keyspace have no replication
> but perhaps restore need same operation on all node.
>
> I miss something, i don't know.
>
> Thanks for your help.
>
>
>
>
>


Re: Try to configure commitlog_archiving.properties

Posted by "Bonnet Jonathan." <jo...@externe.bnpparibas.com>.
Hello,

  As i told you i began to explore restore operations, see my config for
archive commit logs:

archive_command=/bin/bash /produits/cassandra/scripts/cassandra-archive.sh
%path %name

restore_command=/bin/bash /produits/cassandra/scripts/cassandra-restore.sh
%from %to

restore_directories=/produits/cassandra/cassandra_data/archived_commit

restore_point_in_time=2013:12:11 17:00:00

My 2 scripts 

cassandra-archive.sh:

bzip2 --best -k $1
mv $1.bz2 /produits/cassandra/cassandra_data/archived_commit/$2.bz2


cassandra-restore.sh:
cp -f $1 $2
bzip2 -d $2


  
For an example, at 2013:12:11 17:30:00 i had truncate a table which belong
to a keyspace with no replication on one node, after that i made a nodetool
flush. So when i restore to 2013:12:11 17:00:00 i expect to have my table
bein fill up again.

The node restart with this config correctly, i see my archive commit log
come back to my commitlogdirectory, seems bizarre to me that these ones
finish by *.out like CommitLog-3-1386927339271.log.out and not just .log.
Everything is normal ?

When i query my table now, this one is still empty. Finaly my restore
doesn't work and i wonder why ?

Do i have to make a restore on all nodes ? my keyspace have no replication
but perhaps restore need same operation on all node.

I miss something, i don't know.

Thanks for your help.






Re: Try to configure commitlog_archiving.properties

Posted by "Bonnet Jonathan." <jo...@externe.bnpparibas.com>.
Bonnet Jonathan. <jonathan.bonnet <at> externe.bnpparibas.com> writes:

> 
> Thanks Artur,
> 
> You're right i must comment restore directory too.
> 
> Now i'll try to practice around restore.
> 
> Regards,
> 
> Bonnet Jonathan.
> 
> 

Hello,

  As i told you i began to explore restore operations, see my config for
archive commit logs:

archive_command=/bin/bash /produits/cassandra/scripts/cassandra-archive.sh
%path %name

restore_command=/bin/bash /produits/cassandra/scripts/cassandra-restore.sh
%from %to

restore_directories=/produits/cassandra/cassandra_data/archived_commit

restore_point_in_time=2013:12:11 17:00:00

My 2 scripts 

cassandra-archive.sh:

bzip2 --best -k $1
mv $1.bz2 /produits/cassandra/cassandra_data/archived_commit/$2.bz2


cassandra-restore.sh:
cp -f $1 $2
bzip2 -d $2


  
For an example, at 2013:12:11 17:30:00 i had truncate a table which belong
to a keyspace with no replication on one node, after that i made a nodetool
flush. So when i restore to 2013:12:11 17:00:00 i expect to have my table
bein fill up again.

The node restart with this config correctly, i see my archive commit log
come back to my commitlogdirectory, seems bizarre to me that these ones
finish by *.out like CommitLog-3-1386927339271.log.out and not just .log.
Everything is normal ?

When i query my table now, this one is still empty. Finaly my restore
doesn't work and i wonder why ?

Do i have to make a restore on all nodes ? my keyspace have no replication
but perhaps restore need same operation on all node.

I miss something, i don't know.

Thanks for your help.






Re: Try to configure commitlog_archiving.properties

Posted by "Bonnet Jonathan." <jo...@externe.bnpparibas.com>.
Thanks Artur,

You're right i must comment restore directory too.

Now i'll try to practice around restore.

Regards,

Bonnet Jonathan.





Re: Try to configure commitlog_archiving.properties

Posted by "Bonnet Jonathan." <jo...@externe.bnpparibas.com>.
Artur Kronenberg <artur.kronenberg <at> openmarket.com> writes:

> 
> So, looking at the code:
> 
>      public void maybeRestoreArchive()
>      {
>          if (Strings.isNullOrEmpty(restoreDirectories))
>              return;
> 
>          for (String dir : restoreDirectories.split(","))
>          {
>              File[] files = new File(dir).listFiles();
>              if (files == null)
>              {
>                  throw new RuntimeException("Unable to list director " + 
> dir);
>              }
>              for (File fromFile : files)
>              {
>                  File toFile = new 
> File(DatabaseDescriptor.getCommitLogLocation(), new 
> CommitLogDescriptor(CommitLogSegment.getNextId()).fileName());
>                  String command = restoreCommand.replace("%from", 
> fromFile.getPath());
>                  command = command.replace("%to", toFile.getPath());
>                  try
>                  {
>                      exec(command);
>                  }
>                  catch (IOException e)
>                  {
>                      throw new RuntimeException(e);
>                  }
>              }
>          }
>      }
> 
> I would like someone to confirm that, but it might potentially be a bug. 
> It does the right thing for an empty restore directory. However it 
> ignores the fact that the restore command could be empty.
> So for you, jonathan, I reckon you have the restore directory set? You 
> don't need that to be set in order to archive (only if you want to 
> restore it). So set your restore_directory property to empty and you 
> should get rid of those errors. The directory needs to be set when you 
> enable the restore command.
> 
> On a second look, I am almost certain this is a bug, as the maybeArchive 
> command does correctly check for the command to not be empty or null. 
> The maybeRestore command needs to do the same thing for the 
> restoreCommand. If someone confirms, I am happy to raise a bug.
> 
> cheers,
> 
> artur
> 
> On 11/12/13 14:09, Bonnet Jonathan. wrote:
> > Artur Kronenberg <artur.kronenberg <at> openmarket.com> writes:
> >
> >>
> >>      hi Bonnet,
> >>        that doesn't seem to be a problem with your archiving, rather with
> >>        the restoring. What is your restore command?
> >>        -- artur

Hello,

  As i told you i began to explore restore operations, see my config for
archive commit logs:

archive_command=/bin/bash /produits/cassandra/scripts/cassandra-archive.sh
%path %name

restore_command=/bin/bash /produits/cassandra/scripts/cassandra-restore.sh
%from %to

restore_directories=/produits/cassandra/cassandra_data/archived_commit

restore_point_in_time=2013:12:11 17:00:00

My 2 scripts 

cassandra-archive.sh:

bzip2 --best -k $1
mv $1.bz2 /produits/cassandra/cassandra_data/archived_commit/$2.bz2


cassandra-restore.sh:
cp -f $1 $2
bzip2 -d $2


  
For an example, at 2013:12:11 17:30:00 i had truncate a table which belong
to a keyspace with no replication on one node, after that i made a nodetool
flush. So when i restore to 2013:12:11 17:00:00 i expect to have my table
bein fill up again.

The node restart with this config correctly, i see my archive commit log
come back to my commitlogdirectory, seems bizarre to me that these ones
finish by *.out like CommitLog-3-1386927339271.log.out and not just .log.
Everything is normal ?

When i query my table now, this one is still empty. Finaly my restore
doesn't work and i wonder why ?

Do i have to make a restore on all nodes ? my keyspace have no replication
but perhaps restore need same operation on all node.

I miss something, i don't know.

Thanks for your help.






Re: Try to configure commitlog_archiving.properties

Posted by Artur Kronenberg <ar...@openmarket.com>.
So, looking at the code:

     public void maybeRestoreArchive()
     {
         if (Strings.isNullOrEmpty(restoreDirectories))
             return;

         for (String dir : restoreDirectories.split(","))
         {
             File[] files = new File(dir).listFiles();
             if (files == null)
             {
                 throw new RuntimeException("Unable to list director " + 
dir);
             }
             for (File fromFile : files)
             {
                 File toFile = new 
File(DatabaseDescriptor.getCommitLogLocation(), new 
CommitLogDescriptor(CommitLogSegment.getNextId()).fileName());
                 String command = restoreCommand.replace("%from", 
fromFile.getPath());
                 command = command.replace("%to", toFile.getPath());
                 try
                 {
                     exec(command);
                 }
                 catch (IOException e)
                 {
                     throw new RuntimeException(e);
                 }
             }
         }
     }


I would like someone to confirm that, but it might potentially be a bug. 
It does the right thing for an empty restore directory. However it 
ignores the fact that the restore command could be empty.
So for you, jonathan, I reckon you have the restore directory set? You 
don't need that to be set in order to archive (only if you want to 
restore it). So set your restore_directory property to empty and you 
should get rid of those errors. The directory needs to be set when you 
enable the restore command.

On a second look, I am almost certain this is a bug, as the maybeArchive 
command does correctly check for the command to not be empty or null. 
The maybeRestore command needs to do the same thing for the 
restoreCommand. If someone confirms, I am happy to raise a bug.

cheers,

artur

On 11/12/13 14:09, Bonnet Jonathan. wrote:
> Artur Kronenberg <artur.kronenberg <at> openmarket.com> writes:
>
>>
>>      hi Bonnet,
>>        that doesn't seem to be a problem with your archiving, rather with
>>        the restoring. What is your restore command?
>>        -- artur
>>        On 11/12/13 13:47, Bonnet Jonathan. wrote:
>>
>>      
>>        
> Thanks to answear so fast,
>
> I put nothing for restore ? should I ? cause i don't want to restore for the
> moment.
>
> Regards,
>
>
>
>
>


Re: Try to configure commitlog_archiving.properties

Posted by "Bonnet Jonathan." <jo...@externe.bnpparibas.com>.
Artur Kronenberg <artur.kronenberg <at> openmarket.com> writes:

>
> 
>     hi Bonnet,
>       that doesn't seem to be a problem with your archiving, rather with
>       the restoring. What is your restore command? 
>       -- artur
>       On 11/12/13 13:47, Bonnet Jonathan. wrote:
> 
>     
>       
Thanks to answear so fast,

I put nothing for restore ? should I ? cause i don't want to restore for the
moment.

Regards,






Re: Try to configure commitlog_archiving.properties

Posted by Artur Kronenberg <ar...@openmarket.com>.
hi Bonnet,

that doesn't seem to be a problem with your archiving, rather with the 
restoring. What is your restore command?

-- artur

On 11/12/13 13:47, Bonnet Jonathan. wrote:
> Bonnet Jonathan <jonathan.bonnet <at> externe.bnpparibas.com> writes:
>
>> >
>> >Thanks a lot,
>> >
>> >    It Works, i see commit log bein archived. I'll try tomorrow the restore
>> >command. Thanks again.
>> >
>> >Bonnet Jonathan.
>> >
>> >
> Hello,
>
>    I have restart a node today, and i have an error which seems to be in
> relation with commitlog archiving:
>
> ERROR 14:39:00,435 Exception encountered during startup
> java.lang.RuntimeException: java.io.IOException:
> Cannot run program "":
> error=2, No such file or directory
>          at
> org.apache.cassandra.db.commitlog.CommitLogArchiver.maybeRestoreArchive
> (CommitLogArchiver.java:172)
>          at
> org.apache.cassandra.db.commitlog.CommitLog.recover
> (CommitLog.java:104)
>          at
> org.apache.cassandra.service.CassandraDaemon.setup
> (CassandraDaemon.java:305)
>          at
> org.apache.cassandra.service.CassandraDaemon.activate
> (CassandraDaemon.java:461)
>          at
> org.apache.cassandra.service.CassandraDaemon.main
> (CassandraDaemon.java:504)
> Caused by: java.io.IOException: Cannot run program "": error=2, No such file
> or directory
>          at java.lang.ProcessBuilder.start(Unknown Source)
>          at
> org.apache.cassandra.utils.FBUtilities.exec(FBUtilities.java:588)
>          at
> org.apache.cassandra.db.commitlog.CommitLogArchiver.exec
> (CommitLogArchiver.java:182)
>          at
> org.apache.cassandra.db.commitlog.CommitLogArchiver.maybeRestoreArchive
> (CommitLogArchiver.java:168)
>          ... 4 more
> Caused by: java.io.IOException: error=2, No such file or directory
>          at java.lang.UNIXProcess.forkAndExec(Native Method)
>          at java.lang.UNIXProcess.<init>(Unknown Source)
>          at java.lang.ProcessImpl.start(Unknown Source)
>          ... 8 more
> java.lang.RuntimeException: java.io.IOException: Cannot run program "":
> error=2, No such file or directory
>          at
> org.apache.cassandra.db.commitlog.CommitLogArchiver.maybeRestoreArchive
> (CommitLogArchiver.java:172)
>          at
> org.apache.cassandra.db.commitlog.CommitLog.recover
> (CommitLog.java:104)
>          at
> org.apache.cassandra.service.CassandraDaemon.setup
> (CassandraDaemon.java:305)
>          at
> org.apache.cassandra.service.CassandraDaemon.activate
> (CassandraDaemon.java:461)
>          at
> org.apache.cassandra.service.CassandraDaemon.main
> (CassandraDaemon.java:504)
> Caused by: java.io.IOException: Cannot run program "": error=2,
> No such file or directory
>          at java.lang.ProcessBuilder.start(Unknown Source)
>          at org.apache.cassandra.utils.FBUtilities.exec
> (FBUtilities.java:588)
>          at
> org.apache.cassandra.db.commitlog.CommitLogArchiver.exec
> (CommitLogArchiver.java:182)
>          at
> org.apache.cassandra.db.commitlog.CommitLogArchiver.maybeRestoreArchive
> (CommitLogArchiver.java:168)
>          ... 4 more
> Caused by: java.io.IOException: error=2, No such file or directory
>          at java.lang.UNIXProcess.forkAndExec(Native Method)
>          at java.lang.UNIXProcess.<init>(Unknown Source)
>          at java.lang.ProcessImpl.start(Unknown Source)
>          ... 8 more
>
>
>
> No help again on the net, nothing change since the last changes in
> commitlog_archiving.properties.  The first time yesterday that i restart
> there was no problem,and my commitlog bein archived well.
>
> Someone can help me, please ?
>
> Regards,
>
> Bonnet Jonathan.
>
>
>
>
>


Re: Try to configure commitlog_archiving.properties

Posted by "Bonnet Jonathan." <jo...@externe.bnpparibas.com>.
Bonnet Jonathan <jonathan.bonnet <at> externe.bnpparibas.com> writes:

> 
> Thanks a lot,
> 
>    It Works, i see commit log bein archived. I'll try tomorrow the restore 
> command. Thanks again.
> 
> Bonnet Jonathan.
> 
> 

Hello,

  I have restart a node today, and i have an error which seems to be in
relation with commitlog archiving:

ERROR 14:39:00,435 Exception encountered during startup
java.lang.RuntimeException: java.io.IOException: 
Cannot run program "":
error=2, No such file or directory
        at
org.apache.cassandra.db.commitlog.CommitLogArchiver.maybeRestoreArchive
(CommitLogArchiver.java:172)
        at
org.apache.cassandra.db.commitlog.CommitLog.recover
(CommitLog.java:104)
        at
org.apache.cassandra.service.CassandraDaemon.setup
(CassandraDaemon.java:305)
        at
org.apache.cassandra.service.CassandraDaemon.activate
(CassandraDaemon.java:461)
        at
org.apache.cassandra.service.CassandraDaemon.main
(CassandraDaemon.java:504)
Caused by: java.io.IOException: Cannot run program "": error=2, No such file
or directory
        at java.lang.ProcessBuilder.start(Unknown Source)
        at 
org.apache.cassandra.utils.FBUtilities.exec(FBUtilities.java:588)
        at
org.apache.cassandra.db.commitlog.CommitLogArchiver.exec
(CommitLogArchiver.java:182)
        at
org.apache.cassandra.db.commitlog.CommitLogArchiver.maybeRestoreArchive
(CommitLogArchiver.java:168)
        ... 4 more
Caused by: java.io.IOException: error=2, No such file or directory
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(Unknown Source)
        at java.lang.ProcessImpl.start(Unknown Source)
        ... 8 more
java.lang.RuntimeException: java.io.IOException: Cannot run program "":
error=2, No such file or directory
        at
org.apache.cassandra.db.commitlog.CommitLogArchiver.maybeRestoreArchive
(CommitLogArchiver.java:172)
        at
org.apache.cassandra.db.commitlog.CommitLog.recover
(CommitLog.java:104)
        at
org.apache.cassandra.service.CassandraDaemon.setup
(CassandraDaemon.java:305)
        at
org.apache.cassandra.service.CassandraDaemon.activate
(CassandraDaemon.java:461)
        at
org.apache.cassandra.service.CassandraDaemon.main
(CassandraDaemon.java:504)
Caused by: java.io.IOException: Cannot run program "": error=2, 
No such file or directory
        at java.lang.ProcessBuilder.start(Unknown Source)
        at org.apache.cassandra.utils.FBUtilities.exec
(FBUtilities.java:588)
        at
org.apache.cassandra.db.commitlog.CommitLogArchiver.exec
(CommitLogArchiver.java:182)
        at
org.apache.cassandra.db.commitlog.CommitLogArchiver.maybeRestoreArchive
(CommitLogArchiver.java:168)
        ... 4 more
Caused by: java.io.IOException: error=2, No such file or directory
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(Unknown Source)
        at java.lang.ProcessImpl.start(Unknown Source)
        ... 8 more



No help again on the net, nothing change since the last changes in
commitlog_archiving.properties.  The first time yesterday that i restart
there was no problem,and my commitlog bein archived well.

Someone can help me, please ?

Regards,

Bonnet Jonathan.






Re: Try to configure commitlog_archiving.properties

Posted by Bonnet Jonathan <jo...@externe.bnpparibas.com>.
Thanks a lot,

   It Works, i see commit log bein archived. I'll try tomorrow the restore 
command. Thanks again.

Bonnet Jonathan.


Re: Try to configure commitlog_archiving.properties

Posted by Artur Kronenberg <ar...@openmarket.com>.
Hi,

There is some docs on the internet for this operations. It is basically 
as presented in the archive-commitlog file. 
(commitlog_archiving.properties).

The way the operations work: The operation is called automatically with 
parameters that give you control over what you want to do with it. It 
looks to me like your copy command for the archiving wants to copy every 
file. This is unnecessary. Cassandra will give you the arguments. E.g. 
Documentation for the archive command reads:

# Command to execute to archive a commitlog segment
# Parameters: %path => Fully qualified path of the segment to archive
#             %name => Name of the commit log.
# Example: archive_command=/bin/ln %path /backup/%name
#
# Limitation: *_command= expects one command with arguments. STDOUT
# and STDIN or multiple commands cannot be executed.  You might want
# to script multiple commands and add a pointer here.

Argument 1 will give you the path to the files you'd want to copy, while 
argument 2 will give uou the name if it. You can then create a command:

archive_command=/bin/bash /home/cassandra/scripts/cassandra-archive.sh 
%path %name

The above would be an example for me. As the commands by default only 
execute 1 command, I have them point to a custom script that does what I 
desire.

My script then looks something like this:

#! /bin/bash
# use bzip to compress the file
bzip2 --best -k $1
# move to commit log archive
mv $1.bz2 $HOME/commitlog_restore/$2.bz2

I compress my commitlog and then move it somewhere else. Cassandra will 
call this operation first, and then delete the commitlog.
  You can apply similar behaviours to all of those commands.

I would recommend to set up a cleanup scripts, otherwise your saved 
commit-log files will floud your harddrive. I would also test this 
locally first to make sure it works. For testing locally, bare in mind 
that you may wanna set your max file sizes to very low values as the 
command is only called when the commitlog is deleted. So having 
commitlogs that are 250 MB  or bigger will need a lot of writing to make 
the event trigger.

I hope I got that right and it helps.

Cheers.

FYI there was a bug with this, so you may wanna be on the right version:
https://issues.apache.org/jira/browse/CASSANDRA-5909

On 06/12/13 15:33, Vicky Kak wrote:
> >>Why, can you give me a good example and the good way to configure 
> archive
> >>commit logs ?
>
> Take a look at the cassandra code ;)
>
>
> On Fri, Dec 6, 2013 at 3:34 PM, Bonnet Jonathan 
> <jonathan.bonnet@externe.bnpparibas.com 
> <ma...@externe.bnpparibas.com>> wrote:
>
>     Hello,
>
>       I try to configure commitlog_archiving.properties to take
>     advantage of
>     backup and restore at a point of time, but there is no ressources on
>     internet for that. So i need some help.
>
>       If I understand I have 4 parameters:
>
>     archive_command=
>
>     restore_command=
>
>     restore_directories=
>
>     restore_point_in_time=
>
>       Forget for the moment the restore_point_in_time, should i put
>     one command
>     only for the archive_command; my wish is to copy all the commitlogs on
>     another directory:
>
>     restore_directories=/produits/cassandra/cassandra_data/archived_logs
>
>     archive_command=/bin/cp -
>     f /produits/cassandra/cassandra_commit/*.log
>     /produits/cassandra/cassandra_
>     data/archived_logs
>
>     restore_command=/bin/cp -
>     f /produits/cassandra/cassandra_data/archived_logs/*.log
>     /produits/cassandr
>     a/cassandra_commit
>
>     But it doesn't work when i restart the node which interest me, it
>     doesn't
>     copy anything.
>
>     Why, can you give me a good example and the good way to configure
>     archive
>     commit logs ? there's nothing on the net except Datastax Website.
>
>     Thanks for your answear.
>
>     Regards,
>
>     Bonnet Jonathan.
>
>


Re: Try to configure commitlog_archiving.properties

Posted by Robert Coli <rc...@eventbrite.com>.
On Tue, Dec 10, 2013 at 1:45 AM, Bonnet Jonathan <
jonathan.bonnet@externe.bnpparibas.com> wrote:

> Taking a look to the code ? i'm not a develloper but a DBA, where should i
> look ? Thank you.
>

In all seriousness, if you plan to operate Cassandra, get used to the idea
of reading Java source code.

There are many corners of the codebase whose behavior is only
understandable via this method. Especially if you want to be sure of how
the feature works in the exact version you are running. The commit log
archival stuff, which IIRC was contributed by Netflix specifically in order
to support a feature of Priam, is likely a good example.

=Rob

Re: Try to configure commitlog_archiving.properties

Posted by Bonnet Jonathan <jo...@externe.bnpparibas.com>.
Vicky Kak <vicky.kak <at> gmail.com> writes:

> 
> 
> 
> >>Why, can you give me a good example and the good way to configure 
archive
> >>commit logs ?
> Take a look at the cassandra code ;)
> 
> 

Taking a look to the code ? i'm not a develloper but a DBA, where should i 
look ? Thank you.

Regards,

Bonnet Jonathan.



Re: Try to configure commitlog_archiving.properties

Posted by Vicky Kak <vi...@gmail.com>.
>>Why, can you give me a good example and the good way to configure archive
>>commit logs ?

Take a look at the cassandra code ;)


On Fri, Dec 6, 2013 at 3:34 PM, Bonnet Jonathan <
jonathan.bonnet@externe.bnpparibas.com> wrote:

> Hello,
>
>   I try to configure commitlog_archiving.properties to take advantage of
> backup and restore at a point of time, but there is no ressources on
> internet for that. So i need some help.
>
>   If I understand I have 4 parameters:
>
> archive_command=
>
> restore_command=
>
> restore_directories=
>
> restore_point_in_time=
>
>   Forget for the moment the restore_point_in_time, should i put one command
> only for the archive_command; my wish is to copy all the commitlogs on
> another directory:
>
> restore_directories=/produits/cassandra/cassandra_data/archived_logs
>
> archive_command=/bin/cp -
> f /produits/cassandra/cassandra_commit/*.log /produits/cassandra/cassandra_
> data/archived_logs
>
> restore_command=/bin/cp -
> f /produits/cassandra/cassandra_data/archived_logs/*.log /produits/cassandr
> a/cassandra_commit
>
> But it doesn't work when i restart the node which interest me, it doesn't
> copy anything.
>
> Why, can you give me a good example and the good way to configure archive
> commit logs ? there's nothing on the net except Datastax Website.
>
> Thanks for your answear.
>
> Regards,
>
> Bonnet Jonathan.
>
>