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