How do you add, remove, or replace nodes in a Cassandra cluster and what happens during bootstrapping/streaming?
Last updated
Add: a new node bootstraps by claiming token ranges and streaming that data from existing replicas (not serving reads until done). Then run
nodetool cleanupon the old nodes.Remove:
nodetool decommissionon a live node streams its data out.nodetool removenodehandles a dead node by having survivors stream the missing data. Replace a dead node withreplace_address_first_bootto take over its tokens.Streaming is network/disk heavy (throttle via
stream_throughput_outbound), so change one node at a time and repair as needed.
- https://cassandra.apache.org/doc/latest/cassandra/managing/operating/topo_changes.html
- https://cassandra.apache.org/doc/latest/cassandra/managing/tools/nodetool/decommission.html
- https://cassandra.apache.org/doc/stable/cassandra/managing/tools/nodetool/removenode.html
- https://medium.com/@sevanthi404rt/deep-dive-into-cassandra-streaming-66cd1bd67acb
- https://www.pythian.com/blog/replacing-nodes-in-cassandra
- https://thelastpickle.com/blog/2018/02/21/replace-node-without-bootstrapping.html
- https://cassandra.apache.org/doc/4.0/cassandra/operating/topo_changes.html
- https://docs.strangebee.com/thehive/operations/cassandra-cluster/