Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra - Removing a node from the cluster

Tags:

cassandra

I have a cluster with three nodes and I need to remove one node. How can I make sure the data from the node to be removed will be replicated to the two other nodes before I actually remove it? Is this done using snapshots? How should I proceed?

like image 411
J. Volkya Avatar asked Apr 24 '12 21:04

J. Volkya


People also ask

How would you replace a dead node in Cassandra?

In the cassandra. yaml file for each node, remove the IP address of the dead node from the - seeds list in the seed-provider property. If the cluster needs a new seed node to replace the dead node, add the new node's IP address to the - seeds list of the other nodes.

What happens when a node goes down in Cassandra?

When a node comes back online after an outage, it may have missed writes for the replica data it maintains. Repair mechanisms exist to recover missed data, such as hinted handoffs and manual repair with nodetool repair. The length of the outage will determine which repair mechanism is used to make the data consistent.

What is Nodetool cleanup?

Triggers immediate cleanup of keyspaces that no longer belong to a node. Triggers immediate cleanup of keyspaces that no longer belong to a node. OpsCenter provides a Cleanup option in the Nodes UI for Running cleanup.

How Cassandra will behave when one node in the ring goes down?

Cassandra nodes always forms a ring, where each node communicate with their neighboring nodes, i.e. for any node they always gossip with two other nodes. When a node goes down, the ring is broken.


2 Answers

From the doc

You can take a node out of the cluster with nodetool decommission to a live node, or nodetool removenode (to any other machine) to remove a dead one. This will assign the ranges the old node was responsible for to other nodes, and replicate the appropriate data there. If decommission is used, the data will stream from the decommissioned node. If removenode is used, the data will stream from the remaining replicas.

like image 149
Tamil Avatar answered Oct 14 '22 13:10

Tamil


You want to run nodetool decommission on the node you want to remove. This will cause the node to stream all its data to the other nodes and then remove itself from the ring.

like image 31
psanford Avatar answered Oct 14 '22 11:10

psanford