The PropertyFileSnitch uses the
cassandra-topology.properties for datacenters and rack names and to determine network topology so that requests are routed efficiently and allows the database to distribute replicas evenly.
The GossipingPropertyFileSnitch snitch is recommended for production. See Migrating from the PropertyFileSnitch to the GossipingPropertyFileSnitch.
This snitch determines proximity as determined by rack and datacenter.
It uses the network details located in the cassandra-topology.properties file.
When using this snitch, you can define your datacenter names to be whatever you want.
Make sure that the datacenter names correlate to the name of your datacenters in the keyspace definition.
Every node in the cluster should be described in the
cassandra-topology.properties file, and this file should be exactly the same on every node in the cluster.
If you had non-uniform IPs and two physical datacenters with two racks in each, and a third logical datacenter for replicating analytics data, the
cassandra-topology.properties file might look like this:
Datacenter and rack names are case-sensitive.
# datacenter One 188.8.131.52=DC1:RAC1 184.108.40.206=DC1:RAC1 220.127.116.11=DC1:RAC1 18.104.22.168=DC1:RAC2 22.214.171.124=DC1:RAC2 126.96.36.199=DC1:RAC2 # datacenter Two 188.8.131.52=DC2:RAC1 184.108.40.206=DC2:RAC1 220.127.116.11=DC2:RAC1 18.104.22.168=DC2:RAC2 22.214.171.124=DC2:RAC2 126.96.36.199=DC2:RAC2 # Analytics Replication Group 188.8.131.52=DC3:RAC1 184.108.40.206=DC3:RAC1 220.127.116.11=DC3:RAC1 # default for unknown nodes default =DC3:RAC1