The Linux Page

Repair a Cassandra Cluster

I use the Cassandra database cluster system to manage a new set of websites and once in a while I start getting many errors and the website stops working altogether.

When that happens, it is likely that Cassandra broke something in the temporary tables that it holds. The only way to go past that problem is to clear those tables. Until then, it will fail over and over again (they really would need some euristic to auto-clean up even if it means that you're losing some data.)

The command to repair the database, really quick, is as follow:

nodetool scrub snap_websites files

Note that in most cases you don't want to specify the name of the table ("files" here). In your case, you may want to use your context name too: "snap_websites" is the one we use with Snap!

The cleaning (scrubing) may delete data that you last added to the cluster. If you have multiple nodes in your cluster, you can also run the "repair" command to copy missing data from your other nodes, in effect repairing the current node.

Source: apache::thrift::transport::TTransportException — Cassandra times out seemingly because of garbage?