Apache Cassandra 1.2 Documentation

Expanding a Cassandra AMI cluster

This section contains instructions for expanding a cluster created with version 1.2 of the DataStax Community Edition AMI (Amazon Machine Image).

Note

For adding nodes to clusters created prior to Cassandra 1.2, follow the instructions in the 1.1 topic Expanding a Cassandra AMI cluster.

Adding nodes to 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.

  1. 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.

  2. After the nodes are initialized, login to each node and stop the service:

    sudo service cassandra stop
    
  3. Clear the data in each node:

    1. Check the cassandra.yaml for the location of the data directories:

      data_file_directories:
         - /raid0/cassandra/data
      
    2. Remove the data directories:

      sudo rm -rf /raid0/cassandra/*
      

    Note

    You must clear the data because new nodes have existing data from the initial start with the temporary cluster name and settings.

  4. 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: "110.82.155.0,110.82.155.3"
    

    Do not set the initial_token.

  5. Start each node in two minute intervals. You can monitor the startup and data streaming process using nodetool netstats.

    $ sudo service cassandra start
    
  6. Verify that each node has finished joining the ring:

    $ nodetool status

    ../../_images/nodetool_status_ami1.png