Taking a snapshot
Snapshots are taken per node using the nodetool snapshot command.
To take a global snapshot, run the command with a parallel SSH utility, such as pssh.
A snapshot first flushes all in-memory writes to disk, then makes a hard link of the SSTable files for each keyspace.
You must have enough free disk space on the node to accommodate making snapshots of your data files. A single snapshot requires little disk space. However, snapshots can cause your disk usage to grow more quickly over time because a snapshot prevents old obsolete data files from being deleted.
After the snapshot is complete, you can move the backup files to another location if needed, or you can leave them in place.
-
Run
nodetool cleanupto ensure that invalid replicas are removed:nodetool cleanup cycling -
Run the
nodetool snapshotcommand, specifying the keyspace to snapshot and any necessary connection options, such as the hostname or JMX port. For example:nodetool snapshot -t cycling_2017-3-9 cyclingFor tarball installations, run this command from the
/resources/cassandra/bindirectory of your DSE installation.
The response from the nodetool snapshot command includes a Snapshot directory.
This is the name of a subdirectory containing the snapshot files.
Requested creating snapshot(s) for [cycling] with snapshot name [2015.07.17] and options {skipFlush=false}
Snapshot directory: cycling_2017-3-9
The complete path to the snapshot directory is /data/KEYSPACE_NAME/TABLE_NAME-UUID/snapshots/SNAPSHOT_NAME.
If the keyspace contains multiple tables, the snapshot process creates multiple snapshot directories with the given Snapshot directory name.
For example, the following path is for a table named cyclist_name in the cycling keyspace:
data/cycling/cyclist_name-9e516080f30811e689e40725f37c761d/snapshots/cycling_2017-3-9
Within each snapshot directory, there are multiple data files with the extension .db, as well as a schema.cql file that contains the full CQL to create the table.
|
Restoring from a snapshot requires the table schema. |
For example:
manifest.json
mc-1-big-CompressionInfo.db
mc-1-big-Data.db
mc-1-big-Digest.crc32
mc-1-big-Filter.db
mc-1-big-Index.db
mc-1-big-Statistics.db
mc-1-big-Summary.db
mc-1-big-TOC.txt
schema.cql