Scripts to backup your cassandra(no matter whether it's dockerized or not) nodes with snapshots and incremental backups to S3
- Both snapshot and incremental backup are supported
- All keyspaces will be backuped
- Amazon S3 will be used to store the backup files
- Local backup files older than 30 days will be housekept when running
snapshotter.sh
- Local snapshot files will be housekpet when running
snapshotter.sh
- Remote files housekeeping are supposed to be done in S3
Responsibility: capturing snapshots and uploading(compressed) to S3
Responsibility: uploading incremental backups(compressed) to S3
- AWS Command Line Interface (CLI) must be installed in the node
- Script(s)(snapshotter.sh/backupper.sh) must be in one cassandra node (to the mounted folder if cassandra is runing inside a docker container)
- S3 path must exist and must be updated in script file(s)
Logs are appended to log_snapshots.txt
and log_incremental_backups.txt
in the same folder where the script is.
- SNAPSHOT: /var/lib/cassandra/data/$KESPACE/$TABLE*/snapshot/$TIMESTAMP
- INCREMENTAL BACKUP: /var/lib/cassandra/custom_backups/$KESPACE/$TABLE*/backups
./nodetool -h $HOST -p 7199 snapshot $KEYSPACE
./nodetool -h $HOST -p 7199 refresh $KEYSPACE $TABLE
./nodetool -h $HOST -p 7199 flush $KEYSPACE $TABLE