Restoring data to Cassandra
In order to restore data from a snapshot onto a node, follow these steps:
Shut down the node.
Delete the old
commitlog
files:// package based installation $ rm /var/lib/cassandra/commitlog/* // Tar based installation $ rm <install-directory/data/commitlog/*
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
Copy the latest snapshots from the snapshot location to the data directory:
// package based installation $ cp –p /var/lib/Cassandra/data/apache_cassandra_demo_db/user_table-f99a8ec0110611e5833fa9b7a6da1962/snapshots/1437860306074/* /var/lib/Cassandra/data/apache_cassandra_demo_db/user_table...