Backing up a tarball installation
This topic describes how to manually back up an existing DataStax Enterprise (DSE) tarball installation.
Before continuing, make sure you have sufficient disk space to store a complete data snapshot as well as a compress TAR archive of that snapshot.
To back up a DSE installation, do the following:
-
Back up the schema to
schema_filename.cql
usingcqlsh
./installation_location/resources/cassandra/bin/cqlsh host_ip_address:port -e 'DESC SCHEMA;' \ > /backup_path/schema_filename.cql
A schema backup ensures that even if data is lost you can rebuild the database structure.
-
Back up the token ranges to
token_range_filename`using `nodetool
./installation_location/resources/cassandra/bin/nodetool ring > /backup_path/token_range_filename
-
Back up 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"
The prior command results in a comprehensive list of all possible customizable file types. You can customize this list 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"
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
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
, andschema_filename.cql
to a secure location in case you need to restore your existing installation.