Replacing a node

Sometimes, instead of removing a bad node and adding a new one, you want to replace a node. In larger clusters, this becomes important, in that a new node can be designated as a replacement to a prior, down node. This means that, when the node starts up, it will contact the seed nodes and receive the same token ranges as the previous node.

Let's say that 192.168.0.103 goes down, and I need to replace it. I can re-instance a new node, say, 192.168.0.105. To ensure that 105 gets the same token ranges as 103 had, I can add this one line to the end of the cassandra-env.sh file at 105:

JVM_OPTS="$JVM_OPTS -Dcassandra.replace_address=192.168.0.103"

Now, when 105 starts up, it will be assigned the same token ranges that 103 had. ...

Get Mastering Apache Cassandra 3.x - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.