Cassandra Snitch Configuration
The snitch determines how Cassandra maps nodes to datacenters and racks.
Available Snitches
Section titled “Available Snitches”| Snitch | Use Case |
|---|---|
| SimpleSnitch | Single DC, no rack awareness |
| GossipingPropertyFileSnitch | Production (recommended) |
| PropertyFileSnitch | Legacy |
| Ec2Snitch | AWS single region |
| Ec2MultiRegionSnitch | AWS multi-region |
| GoogleCloudSnitch | GCP |
| RackInferringSnitch | IP-based inference |
GossipingPropertyFileSnitch (Recommended)
Section titled “GossipingPropertyFileSnitch (Recommended)”Configuration
Section titled “Configuration”endpoint_snitch: GossipingPropertyFileSnitchdc=datacenter1rack=rack1
# Optionalprefer_local=truedc_suffix=_analyticsMulti-DC Set up
Section titled “Multi-DC Set up”# Node in DC1dc=us-eastrack=rack1
# Node in DC2dc=eu-westrack=rack1Cloud Snitches
Section titled “Cloud Snitches”AWS (Ec2Snitch)
Section titled “AWS (Ec2Snitch)”endpoint_snitch: Ec2Snitch
# Automatic:# DC = region (us-east-1)# Rack = availability zone (us-east-1a)AWS Multi-Region
Section titled “AWS Multi-Region”endpoint_snitch: Ec2MultiRegionSnitchlisten_address: <private_ip>broadcast_address: <public_ip>endpoint_snitch: GoogleCloudSnitch
# Automatic:# DC = project:region# Rack = zoneChanging Snitch
Section titled “Changing Snitch”# 1. Update cassandra.yaml on all nodes# 2. Update cassandra-rackdc.properties# 3. Rolling restart cluster# 4. Run repair
nodetool repair -fullVerifying Topology
Section titled “Verifying Topology”# Check datacenter/rack assignmentnodetool status
# Detailed gossip infonodetool gossipinfo | grep -E "DC|RACK"Next Steps
Section titled “Next Steps”- cassandra.yaml - Main config
- Replication - Replication config