Adding nodes to an existing cluster
Steps to add nodes when using virtual nodes.
Virtual nodes (vnodes) greatly simplify adding nodes to an existing cluster:
- Calculating tokens and assigning them to each node is no longer required.
- Rebalancing a cluster is no longer necessary because a node joining the cluster assumes responsibility for an even portion of the data.
For a detailed explanation about how vnodes work, see Virtual nodes.
Procedure
Be sure to install the same version of Cassandra as is installed on the other nodes in the cluster. See Installing prior releases of DataStax Community.
What's next
Starting multiple new nodes
If you have added more than one node:
- Make sure you start each node with consistent.rangemovement
property turned off:
- Package installations
- On each of the nodes you are bootstrapping, add the following option
to the /usr/share/cassandra/cassandra-env.sh
file:
JVM_OPTS="$JVM_OPTS -Dcassandra.consistent.rangemovement=false
- Tarball installations
- Start Cassandra on each of the nodes you are bootstrapping with this
option:
$ bin/cassandra -Dcassandra.consistent.rangemovement=false
- Allow two minutes between node startups.
- After each new node has bootstrapped, turn consistent range movement back on for
each one:
- Package installations
- Stop Cassandra and
remove the line you added to
/usr/share/cassandra/cassandra-env.sh in
the previous
step:
JVM_OPTS="$JVM_OPTS -Dcassandra.consistent.rangemovement=false
Then restart Cassandra.
- Tarball installations
- Stop Cassandra, then
restart with this
option:
$ bin/cassandra -Dcassandra.consistent.rangemovement=false
- After restarting the nodes, go to back to step 4 above to verify the new nodes.
What's next
Promoting a node as a seed node
A seed node does not bootstrap, so a new node can't be configured as one immediately. After you have bootstrapped new nodes in the cluster, follow these steps for each one you want to promote as a seed node.
- Stop Cassandra on the node you want to promote.
- Open the node's cassandra.yaml file and add the node's address to the seed_provider list.
- Make this change on all other nodes in the cluster.
- Start Cassandra as a service or a stand-alone process.