Node restart method

A method for restoring from a snapshot. This method requires shutting down and starting nodes.

If restoring a single node, you must first shutdown the node. If restoring an entire cluster, you must shut down all nodes, restore the snapshot data, and then start all nodes again.

Note: Restoring from snapshots and incremental backups temporarily causes intensive CPU and I/O activity on the node being restored.

Procedure

  1. Shut down the node.
  2. To ensure that data is not lost, run nodetool drain. This is especially important if only a single table is restored.
  3. Clear all files in the commitlog directory:
    • Packaged installs: /var/lib/cassandra/commitlog
    • Tarball installs: install_location/data/commitlog

    This prevents the commitlog replay from putting data back, which would defeat the purpose of restoring data to a particular point in time.

  4. Delete all *.db files in data_directory_location/keyspace_name/table_name directory, but DO NOT delete the /snapshots and /backups subdirectories.
    where data_directory_location is
    • Packaged installs: /var/lib/cassandra/data
    • Tarball installs: install_location/data/data
  5. Locate the most recent snapshot folder in this directory:

    data_directory_location/keyspace_name/table_name/snapshots/snapshot_name

  6. Copy its contents into this directory:

    data_directory_location/keyspace_name/table_name directory.

  7. If using incremental backups, copy all contents of this directory:

    data_directory_location/keyspace_name/table_name/backups

  8. Paste it into this directory:

    data_directory_location/keyspace_name/table_name

  9. Restart the node.

    Restarting causes a temporary burst of I/O activity and consumes a large amount of CPU resources.

  10. Run nodetool repair.