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:

  1. Back up 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

    A schema backup ensures that even if data is lost you can rebuild the database structure.

  2. Back up the token ranges to token_range_filename`using `nodetool.

    /installation_location/resources/cassandra/bin/nodetool  ring  > /backup_path/token_range_filename
  3. 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.

  4. 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.

  5. 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"
  6. 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
  7. 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.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com