Backing up a tarball installation
Backup your existing DSE tarball installation.
- Backup the schema to schema_filename.cql using
cqlsh.
/installation_location/resources/cassandra/bin/cqlsh host_ip_address:port -e 'DESC SCHEMA;' \ > /backup_path/schema_filename.cql
Note: A schema backup ensures that even if data is lost you can rebuild the database structure. - Backup the token ranges to token_range_filename using
nodetool.
/installation_location/resources/cassandra/bin/nodetool ring > /backup_path/token_range_filename
- Backup your DSE configuration files.
Add the following configuration file types to a plain text file listing, backup_file_listing.
- *.yaml
- *.sh
- *.xml
- *.properties
- *.default
find /installation_location -type f -name "*.yaml" -o -name "*.sh" -o -name "*.xml" \ -o -name "*.properties" -o -name "*.default" -type f >> "/backup_path/backup_file_listing"
Note: The above is a comprehensive list of all possible customizable file types. Feel free to customize depending upon your requirements. - Create a full snapshot, snapshot_name, using nodetool and add the
snapshot filenames to a plain text file listing,
backup_file_listing.
/installation_location/resources/cassandra/bin/nodetool snapshot -t snapshot_name find /data_directory_location/ -path */snapshots/snapshot_name/* -type f >> "/backup_path/backup_file_listing"
Important: Make note of the snapshot name in case a restore is required. - Add the commit logs to the plain text file listing,
backup_file_listing.
sudo find /data_directory_location/commitlog -type f >> "/backup_path/backup_file_listing"
- Tar up all the backup files into a single archive,
backup_archive_name.tar, using the file list,
backup_file_listing.
sudo /bin/tar -pzcvf /backup_path/backup_archive_name.tar --files-from=/backup_path/backup_file_listing
Tip: For large snapshots, consider using the nice command to reduce the load on the node:sudo /usr/bin/nice -10 /bin/tar -pzcvf /backup_path/backup_archive_name.tar --files-from=/backup_path/backup_file_listing
- Copy backup_archive_name.tar, token_range_filename, and schema_filename.cql to a secure location in case you need to restore your existing installation.