Skip to content

Instantly share code, notes, and snippets.

View rodneytamblyn's full-sized avatar

Rodney Tamblyn rodneytamblyn

View GitHub Profile
rodneytamblyn / .bash_aliases
Last active March 24, 2022 10:13
docker cassandra graceful shutdown and safe restart
alias shutdown="cass-gracefulStopDatabase-and-reboot"
rodneytamblyn /
Created March 23, 2022 23:23 — forked from tobert/
Quick & dirty cassandra-in-docker backup script
# A quick & dirty backup script for Cassandra running inside Docker.
# Assumes /var/lib/cassandra is mounted in the container as /var/lib/cassandra because
# docker inspect {{ .Volumes }} is not shell-friendly. (doable, but meh)
# Also assumes Cassandra was started with 'docker run --name cassandra'.
export PATH=$PATH:/home/atobey/bin:/usr/local/bin
set -e
//READ nodetool snapshot documentation in cassandra
//READ stack-overflow-topic gist or directly in stackoverflow ->
//EXPORT the databases schemas
cqlsh -e "DESCRIBE SCHEMA" > my_backup_name.schema
//Create snapshot of the whole server
nodetool snapshot my_backup_name
//Compress the backups