Ec2Snitch

Use with Amazon EC2 in a single region.

Use the Ec2Snitch for simple cluster deployments on Amazon EC2 where all nodes in the cluster are within a single region.

The region name is treated as the data center name and availability zones are treated as racks within a data center. For example, if a node is in the us-east-1 region, us-east is the data center name and 1 is the rack location. (Racks are important for distributing replicas, but not for data center naming.) Because private IPs are used, this snitch does not work across multiple regions.

If you are using only a single data center, you do not need to specify any properties.

If you need multiple data centers, set the dc_suffix options in the cassandra-rackdc.properties file. Any other lines are ignored. The location of this file depends on the type of installation:
  • Packaged installs: /etc/cassandra/cassandra-rackdc.properties
  • Tarball installs: install_location/conf/cassandra-rackdc.properties
For example, for each node within the us-east region, specify the data center in its cassandra-rackdc.properties file:
Note: Data center names are case-sensitive.
  • node0

    dc_suffix=_1_cassandra

  • node1

    dc_suffix=_1_cassandra

  • node2

    dc_suffix=_1_cassandra

  • node3

    dc_suffix=_1_cassandra

  • node4

    dc_suffix=_1_analytics

  • node5

    dc_suffix=_1_search

This results in three data centers for the region:
us-east_1_cassandra
us-east_1_analytics
us-east_1_search
Note: The data center naming convention in this example is based on the workload. You can use other conventions, such as DC1, DC2 or 100, 200.

Keyspace strategy options 

When defining your keyspace strategy options, use the EC2 region name, such as ``us-east``, as your data center name.