Restoring data to Cassandra

In order to restore data from a snapshot onto a node, follow these steps:

  1. Shut down the node.
  2. Delete the old commitlog files:
    // package based installation
    $ rm /var/lib/cassandra/commitlog/*
    // Tar based installation
    $ rm <install-directory/data/commitlog/*
    
  3. Delete the old SSTable files from <data-dir>/<keyspace-name>/<column-family-name>/:
    // package based installation
    $ rm /var/lib/Cassandra/data/apache_cassandra_demo_db/user_table-f99a8ec0110611e5833fa9b7a6da1962/*.db
    // Tar based installation, considering tar is unpacked at /opt/cassandra location
    $ rm /opt/cassandra/data/data/apache_cassandra_demo_db/user_table-f99a8ec0110611e5833fa9b7a6da1962/*.db
    
  4. Copy the latest snapshots from the snapshot location to the data ...

Get Apache Cassandra Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.