O'Reilly logo

Apache Cassandra Essentials by Nitin Padalia

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required