Cassandra backup best practices

1) Is it necessary to take backup of Cassandra DB even if regular backups of the underlying VMs are taken?

2) Also if backup of Cassandra is indeed required then would it be feasible to take back up of one server in one DC?

Solved Solved
0 4 4,470
1 ACCEPTED SOLUTION

The recommended approach is to take regular snapshots of all nodes.

1) Yes. It's always best to decouple the data from the VM. For example: you could have some unrecoverable issue present on a VM snapshot dating back to the previous reboot of the VM. Recent VM snapshots might not be recoverable in this scenario, but if you had a DB backup, you could create a new VM and restore just the data.

2) Backing up only 1 Cassandra node does not back up all the data, only that node's data (which might only be half, 1/3, 1/4, etc of the data, depending on your configuration). The very first line here https://docs.datastax.com/en/cassandra/2.1/cassandra/operations/ops_backup_takes_snapshot_t.html states: "Snapshots are taken per node using the nodetool snapshot command. To take a global snapshot, run the nodetool snapshot command using a parallel ssh utility, such as pssh."

You don't HAVE to use pssh, that was merely an example they provided. You could do this via cron or however you're already doing it, but you must do it on all nodes.

View solution in original post

4 REPLIES 4

The recommended approach is to take regular snapshots of all nodes.

1) Yes. It's always best to decouple the data from the VM. For example: you could have some unrecoverable issue present on a VM snapshot dating back to the previous reboot of the VM. Recent VM snapshots might not be recoverable in this scenario, but if you had a DB backup, you could create a new VM and restore just the data.

2) Backing up only 1 Cassandra node does not back up all the data, only that node's data (which might only be half, 1/3, 1/4, etc of the data, depending on your configuration). The very first line here https://docs.datastax.com/en/cassandra/2.1/cassandra/operations/ops_backup_takes_snapshot_t.html states: "Snapshots are taken per node using the nodetool snapshot command. To take a global snapshot, run the nodetool snapshot command using a parallel ssh utility, such as pssh."

You don't HAVE to use pssh, that was merely an example they provided. You could do this via cron or however you're already doing it, but you must do it on all nodes.

What is the best strategy for C* backup? A setup has a 3 node Cassandra cluster and scheduled backups with 1 hour delay on three nodes. A backup process triggered on second node before the backup process completed on the first node. Is ensuring sufficient delay between the backups for each node the only solution here?

Incremental backups can also be considered. A snapshot at a point in time, plus all incremental backups and commit logs since that time form a complete backup.

http://docs.datastax.com/en/archived/cassandra/2.0/cassandra/operations/ops_backup_incremental_t.htm...

Not applicable

Customers can use the backup/restore command provided by Edge:

http://docs.apigee.com/private-cloud/latest/backup-and-restore

It is recommended to have backups of all nodes with the same configuration state. Notice I'm talking about configuration not data, data may be different across nodes and that is ok.