Mark
Mark

Reputation: 863

Remove all data Cassandra?

I have a eight node cassandra setup. I am saving data with 3 days TTL. But the data is useless after I take a summary (using my java script, count of things etc). I want to delete all the data in a table. I can stop cassandra for sometime to do the deletion. So the data is removed from all nodes. Should I run truncate and nodetool repair afterwards or should I flush first then delete. Whats the proper way to do it.

Upvotes: 4

Views: 1192

Answers (1)

Evan Volgas
Evan Volgas

Reputation: 2911

You can drop the tables or truncate them... but keep in mind that Cassandra will snapshot your tables by default, so you'll also need to run nodetool clearsnapshot on all of your nodes afterwards. There is no need to stop Cassandra while you do this delete.

I don't know that there is a right way per se... but when I do when I need to clear a table is, first, I run truncate on the table using cqlsh. Then I run nodetool clearsnapshot on my nodes using pssh (https://code.google.com/p/parallel-ssh/).

Hope this helps

Upvotes: 4

Related Questions