3

I'm using Cassandra 2.1.9 Keyspace

WITH replication = {'class': 'NetworkTopologyStrategy', 'datacenter1': '4'}  AND durable_writes = true;

Now one node is down and i want to truncate one of the tables. How can i do it? I cannot start my 4th node now. How can i prevent such problem in future?

Abhishek Agarwal
  • 846
  • 4
  • 13
  • 34

1 Answers1

7

Simple answer is that you need to have all nodes up to execute truncate command. Documentation states: Note: The consistency level must be set to ALL prior to performing a TRUNCATE operation. All replicas must remove the data.

If you really want to truncate table you will first have to decommission that downed node and remove it from the ring.

Matija Gobec
  • 850
  • 6
  • 12
  • 1
    Hello, for cassandra newbies, could you elaborate or point to what this means? – mrbTT Apr 25 '19 at 20:21
  • 1
    This means that there is a node in the cluster that is not behaving normally. You can find out which node by running `nodetool status`. Healthy nodes will show up as "UP" (Up/Normal). If any node has another status, you should determine why. – conradkleinespel Dec 02 '21 at 11:10