Expanding a Cassandra AMI cluster
Expanding a cluster that uses virtual nodes (created with the AMI for DataStax Community 1.2 and later).
For adding nodes to clusters that use the single-token-per-node architecture, follow the instructions in the 1.1 topic Expanding a Cassandra AMI cluster.
Virtual nodes (vnodes) greatly simplify adding nodes to an existing cluster. For a detailed explanation about how this works, see Vnodes.
In the AWS Management Console, create the number of nodes
you need in another cluster with a temporary name, as described in Launching the DataStax Community AMI.
The temporary name prevents the new nodes from joining the cluster with the wrong settings.
After the nodes are initialized, login to each node and stop the service:
$ sudo service cassandra stop
Clear the data in each node:
Check the cassandra.yaml for the location of the
data_file_directories: - /raid0/cassandra/data
Remove the data directories:
$ sudo rm -rf /raid0/cassandra/*
- Check the cassandra.yaml for the location of the data directories:
For each node, set the following properties in the
cassandra.yaml configuration file. For example:
cluster_name: 'NameOfExistingCluster' ... num_tokens: 256 ... seed_provider: - class_name: org.apache.cassandra.locator.SimpleSeedProvider parameters: - seeds: "184.108.40.206,220.127.116.11"
Do not set the initial_token.
- If adding nodes to an existing data center, set auto_bootstrap: true.
- If adding nodes to a new data center, set auto_bootstrap: false.
Start each node in two minute intervals:
$ sudo service cassandra start
You can monitor the start-up and data streaming process using nodetool netstats.
Verify that each node has finished joining the ring:
$ nodetool status
Each node should show UN (Up/Normal) not UJ (Up/Joining).