Database / Apache Cassandra Intermediate and Advanced interview questions
How do you add a new node to a Cassandra cluster?
Adding a node is designed to be an online operation — the rest of the cluster keeps serving traffic while the new node joins and streams data.
- Install Cassandra on the new host and configure
cassandra.yaml: samecluster_name, correctseedslist (pointing at existing nodes, not itself), correct snitch, and appropriatelisten_address/rpc_address. - Start the Cassandra process. The node contacts the seeds via gossip, learns the cluster topology, and is assigned token ranges (automatically, under vnodes).
- The node enters bootstrap mode: it streams the data it now owns from the existing replicas responsible for those token ranges, without yet serving client reads.
- Once bootstrap completes, the node announces itself as fully joined via gossip and starts serving reads and writes for its owned ranges.
- Afterward, run
nodetool cleanupon the existing nodes so they discard data they no longer own now that the new node has taken over part of their previous token ranges.
Best practice is to add one node at a time (or use nodetool bootstrap resume if a join is interrupted) and monitor streaming progress with nodetool netstats before adding the next.
More Related questions...