Search code examples
cassandracassandra-3.0nodetool

How to reuse a cassandra node after decommission?


I had a cluster with 2 nodes (node 1 and node 2).

After decommissioning node 2 I wanted to use the server as a fresh Cassandra database for other purposes, but as soon as I restart this message appears:

org.apache.cassandra.exceptions.ConfigurationException: This node was decommissioned and will not rejoin the ring unless cassandra.override_decommission=true has been set, or all existing data is removed and the node is bootstrapped again

So I removed all existing data.

But I don't want the node to be bootstrapped again (neither rejoin the previous ring) but to be a fresh new and pure Cassandra database to be used.

The old node is not on the seed list.

Cassandra version: 3.9

EDIT: I think I was missunderstood, sorry for that. After the decommission I want to have:

  • Db1: node 1
  • Db2: node 2

Two diferent databases with no correlation, totally separated. That's because we want to reuse the machine where node2 is hosted again to deploy a Cassandra DB in another enviroment.


Solution

  • Don't use override_decommission. That flag is only used for rejoining the same cluster.

    You should remove all data files on the node (Cassandra will recreate system tables on start). Most importantly you need to change the seed in cassandra.yaml. I suspect that it is still the ip of node 1, so you need to change it to node 2 (itself).