This section contains instructions for expanding a cluster created with version 1.2 of the DataStax Community Edition AMI (Amazon Machine Image).
For adding nodes to clusters created prior to Cassandra 1.2, follow the instructions in the 1.1 topic Expanding a Cassandra AMI cluster.
Virtual nodes greatly simplify adding nodes to an existing cluster. For a detailed explanation about how this works, see Virtual nodes in Cassandra 1.2.
In the AWS Management Console, create the number of nodes you need in another cluster with a temporary name. See Installing a Cassandra cluster on Amazon EC2.
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 directories:
data_file_directories: - /raid0/cassandra/data
Remove the data directories:
sudo rm -rf /raid0/cassandra/*
You must clear the data because new nodes have existing data from the initial start with the temporary cluster name and settings.
Set the following properties in the cassandra.yaml configurtion file. For example:
cluster_name: 'NameOfExistingCluster' ... num_tokens: 256 ... seed_provider: - class_name: org.apache.cassandra.locator.SimpleSeedProvider parameters: - seeds: "126.96.36.199,188.8.131.52"
Do not set the initial_token.
Start each node in two minute intervals. You can monitor the startup and data streaming process using nodetool netstats.
$ sudo service cassandra start
Verify that each node has finished joining the ring:
$ nodetool status