Sat
Sat

Reputation: 4158

Can we truncate tables in cassandra, If any one of the node is down

In my Project I am using Cassandra for DB, 3 nodes have created for this. Here the problem is some times due to disk space issue, one of the node is going down, at that time I tried to truncate the tables, but I am not able to truncate them, I am getting something like CONSISTENCY LEVEL related issue. So what I am doing is, I am moving some data to another location then restarting the cassandra, once it is up then I am truncating the tables. Here my question is, without making the one node up(Out of 3 nodes), can we truncate the tables?

Upvotes: 0

Views: 1589

Answers (1)

Simon Fontana Oscarsson
Simon Fontana Oscarsson

Reputation: 2124

You need all nodes available or the command will fail.

TRUNCATE sends a JMX command to all nodes, telling them to delete SSTables that hold the data from the specified table. If any of these nodes is down or doesn't respond, the command fails and outputs a message like the following:

https://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlTruncate.html

Upvotes: 1

Related Questions