Database Reference
In-Depth Information
$ nodetool snapshot MainKeyspace -cf events -t
2013_01_27_14_00_00-events-cs1
Requested snapshot for: MainKeyspace and column
family: events
Snapshot directory: 2013_01_27_14_00_00-events-cs1
Naming conventions make the programmatic storage and retrieval of backups
much easier as well. Another thing to keep in mind is that if you have the drive
space, there is no need to move every backup out of the snapshot directory. It is
generally a good idea to keep the latest version of each backup in the snapshot dir-
ectory to maintain the capability to restore quickly if the need arises.
Removing Snapshots
If you are going to keep only the latest snapshot of a particular backup, it would
be handy to know how to delete it. Removing snapshots is particularly easy if they
are named and named programmatically. If you know that you've taken a snapshot
of a few ColumnFamilys in multiple keyspaces with a timestamp as the snapshot
name, you can simply issue the command shown in Listing 7.14 , and it will iterate
over all the ColumnFamilys in all the keyspaces on the machine and remove any
snapshot with that name. This includes snapshots of the System Keyspace.
Listing 7.14 Clear Any Snapshot with the Name 1361544837468
Click here to view code image
$ nodetool clearsnapshot -t 1361544837468
Requested snapshot for: all keyspaces
You can also remove snapshots at a more granular level by keyspace or even
by ColumnFamily. To remove the snapshot that we took earlier of the events
ColumnFamily in the MainKeyspace , run the command shown in Listing 7.15 .
Listing 7.15 Removing a Named Snapshot of events ColumnFamily from
MainKeyspace
Click here to view code image
$ nodetool clearsnapshot MainKeyspace -t
2013_01_27_14_00_00-events-cs1
Requested snapshot for: MainKeyspace
 
 
Search WWH ::




Custom Search