Backup and restoration

Cassandra provides a simple backup tool called nodetool snapshot to take incremental snapshots and back up of data. The snapshot command flushes MemTables to the disk and creates a backup by creating a hard link to SSTables (SSTables are immutable).

Note

Hard link is a directory entry associated with file data on a filesystem. It can roughly be assumed as an alias to a file that refers to the location where data is stored. It is unlike a soft link that just aliases filenames, not the actual underlying data.

These hard links stay under the data directory, which is placed under <keyspace>/<column_family>/snapshots.

The general plan to back up a cluster roughly follows these steps:

  1. Take a snapshot of each node one by one. The

Get Mastering Apache Cassandra - Second Edition 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.