question

chmeghana03_193926 avatar image
chmeghana03_193926 asked Erick Ramirez edited

Can we replace a node that is down with a new node to take over the same token range(s)?

Can we replace a node(say X) that is down with a new node(say Y) and make it act similar to X ? Can we make some arrangement that the node ranges of X and Y are same?

cassandrareplace nodes
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered Erick Ramirez edited

Yes, you can. That is the whole idea behind replacing a dead node say for example a node that's had a hardware failure.

There are different ways of handling this depending on the situation you're facing.

The replace_address flag

If a server has had a full hardware failure and is unrecoverable, you can replace it with a new server. You just need to install Cassandra on it and configure it in exactly the same way as the node being replaced.

You will also need to configure it with the replace_address flag configured in the cassandra-env.sh with the dead node's IP address:

JVM_OPTS="$JVM_OPTS -Dcassandra.replace_address=ip_of_dead_node

This will let the replacement bootstrap with the exact token(s) assignments as the dead node.

For details, see Replacing a dead node.

Disk swap

If the dead node's drives are still intact, you can simply swap them into a new server provided they're still in working order. When Cassandra starts, the rest of the nodes in the cluster will recognise the server as a new node with a new IP address but with the data and token(s) exactly the same.

If for some reason only the data/ disk is recoverable, you can mount it to the new server but you will still need to install and configure Cassandra. But as above, when you start C* it will recognise the server as a new node with a new IP address and will be part of the cluster as normal since the data and token(s) are the same. Cheers!

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.