Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra: backup entire keyspace [closed]

I was just wondering what would be the best way to backup an entire keyspace in Cassandra... what do you think?

Previously i just copied the data folder into my backup hard drive, but then i had problems to restore the database after updating.

like image 725
siannone Avatar asked May 05 '12 21:05

siannone


People also ask

How do I restore an incremental backup in Cassandra?

By default, incremental backup is disabled in Cassandra. This can be enabled by changing the value of “incremental_backups” to “true” in the cassandra. yaml file. Once enabled, Cassandra creates a hard link to each memtable flushed to SSTable to a backup's directory under the keyspace data directory.

What is Keyspace in Cassandra?

In a Cassandra cluster, a keyspace is an outermost object that determines how data replicates on nodes. Keyspaces consist of core objects called column families (which are like tables in RDBMS), rows indexed by keys, data types, data center awareness, replication factor, and keyspace strategy.


1 Answers

The best way is by doing snapshots (nodetool snapshot). You can learn a lot about how that works and how best to use it in this Datastax documentation (disclaimer: I work for Datastax).

You'll want to make sure you have JNA enabled (some relevant instructions can be found on this page). If you do, snapshots are extremely fast; they're just hard links to existing sstables. No copying needs to be done. You can combine snapshots with other backup tools (or just rsync, cp, etc) if you want to keep track of your backups in a particular way.

like image 138
the paul Avatar answered Oct 26 '22 05:10

the paul