hjarraya
hjarraya

Reputation: 326

Cassandra Scrub - define a destination directory for snapshot

In my C* 1.2.4 setup, I have an ssd drive of 200Gb for the data and a rotational drive for commit logs of 500Gb.

I had the unpleasant surprise during a scrub operation to fill in my ssd drive with the snapshots. That made the cassandra box unresponsive but it kept the status as up when doing nodetool status.

I am wondering if there is a way to specify the target directory for snapshots when doing a scrub.

Otherwise if you have ideas for workarounds? I can do a column family at a time and then copy the snapshots folder, but I am open for smarter solutions.

Thanks,

H

Upvotes: 1

Views: 350

Answers (1)

Richard
Richard

Reputation: 11100

Snapshots in Cassandra are created as hard links to your existing data files. This means at the time the snapshot is taken, it takes up almost no extra space. However, it causes the old files to remain so if you delete or update data, the old version is still there.

This means snapshots must be taken on the drive that stores the data. If you don't need the snapshot any more, just delete it with 'nodetool clearsnapshot' (see the nodetool help output for how to decide which snapshots to delete). If you want to keep the snapshot then you can move it elsewhere. It will only start using much disk space after a while, so you could keep it until you are happy the scrub didn't delete important data then delete the snapshot.

Upvotes: 3

Related Questions