Replacing a Cassandra node with replace_address flag returns "Cannot replace address with a node that is already bootstrapped"

Viewed 191

I'm using Cassandra 3.9 and the data on one of the nodes got corrupted, so had to wipe it entirely. I want to restart it and get all the data back from other nodes.

Using JVM_OPTS="$JVM_OPTS -Dcassandra.replace_address=xx.xx.xx.xx gives me the error Node already bootstrapped since the IP address is the same. I'm confused on what are the necessary steps here.

2 Answers

A replace_address shouldn't be necessary.

Of course, it'll rejoin empty and try to serve requests. Which will fail until a nodetool rebuild or nodetool repair completes.

If you want to re-bootstrap it, I would run a nodetool removenode from one of the "good" nodes. Then restart Cassandra on the wiped node, and it should re-bootstrap itself while also not serving requests until done.

You are getting this exception with replace_address:

Cannot replace address with a node that is already bootstrapped

because you didn't wipe out the data/ directory completely.

A node is flagged as "bootstrapped" when the bootstrapped column in the system.local table is set to COMPLETED. If the data/ directory is empty on startup, the system.local table will be empty so the node would bootstrap as normal. The exceptions are:

  1. The node itself is listed in its seeds list in cassandra.yaml.
  2. The auto_bootstrap property is set to false in cassandra.yaml.
Related