Archive Logs & Redologs (commit logs) Parameters that need to effect.
commitlog_directory: /root/.ccm/geek_cluster/node1/commitlogs
commitlog_directory: /root/.ccm/geek_cluster/node1/commitlogs
commitlog_segment_size_in_mb: 32
commitlog_sync: periodic
commitlog_sync_period_in_ms: 10000
/.ccm/geek_cluster/node1/resources/cassandra/conf/commitlog_archiving.properties file to keep archive_command
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.
Follow Me!!!