cassandra-rackdc.properties file

Several snitch options use cassandra-rackdc.properties to describe where a node belongs in the cluster topology. Cassandra uses that information to route requests and to place replicas across failure domains.

If the datacenter or rack values are wrong, Cassandra may still start, but it can place replicas in the wrong failure domain or route reads to the wrong nodes.

The usual choices are:

Deployment Snitch Use this when…​

On-premises or mixed environments

GossipingPropertyFileSnitch

You want to set dc and rack locally and let gossip share the values.

Single-region AWS

Ec2Snitch

You want AWS metadata to supply the local availability zone mapping.

Multi-region AWS

Ec2MultiRegionSnitch

You need cross-region connectivity and public addresses for replica placement.

Custom layout or non-standard topology

PropertyFileSnitch

You want to define every node explicitly in cassandra-topologies.properties.

The GossipingPropertyFileSnitch is recommended for production when you manage the topology file locally. It uses the datacenter and rack information configured in cassandra-rackdc.properties and propagates the values to other nodes using gossip.

The AWS EC2 snitches are configured for clusters in AWS. They use the cassandra-rackdc.properties options to select one of two AWS EC2 datacenter and rack naming conventions:

  • legacy: Datacenter name is the part of the availability zone name preceding the last "-" when the zone ends in -1 and includes the number if not -1. Rack name is the portion of the availability zone name following the last "-".

    Examples: us-west-1a ⇒ dc: us-west, rack: 1a; us-west-2b ⇒ dc: us-west-2, rack: 2b;

  • standard: Datacenter name is the standard AWS region name, including the number. Rack name is the region plus the availability zone letter.

    Examples: us-west-1a ⇒ dc: us-west-1, rack: us-west-1a; us-west-2b ⇒ dc: us-west-2, rack: us-west-2b;

Either snitch can set to use the local or internal IP address when multiple datacenters are not communicating.

GossipingPropertyFileSnitch

dc

Name of the datacenter. The value is case-sensitive.

Default value: DC1

rack

Rack designation. The value is case-sensitive.

Default value: RAC1

AWS EC2 snitch

ec2_naming_scheme

Datacenter and rack naming convention. Options are legacy or standard (default). This option is commented out by default.

Default value: standard

YOU MUST USE THE legacy VALUE IF YOU ARE UPGRADING A PRE-4.0 CLUSTER.

Either snitch

prefer_local

Option to use the local or internal IP address when communication is not across different datacenters. This option is commented out by default.

Default value: true