cassandra-topologies.properties file

The PropertyFileSnitch snitch option uses the cassandra-topologies.properties configuration file to determine which datacenters and racks cluster nodes belong to. If other snitches are used, the cassandra-rackdc.properties must be used. The snitch determines network topology (proximity by rack and datacenter) so that requests are routed efficiently and allows the database to distribute replicas evenly.

Include every node in the cluster in the properties file, defining your datacenter names as in the keyspace definition. The datacenter and rack names are case-sensitive.

The cassandra-topologies.properties file must be copied identically to every node in the cluster.

Example

This example uses three datacenters:

  1. # datacenter One
  2. 175.56.12.105=DC1:RAC1
  3. 175.50.13.200=DC1:RAC1
  4. 175.54.35.197=DC1:RAC1
  5. 120.53.24.101=DC1:RAC2
  6. 120.55.16.200=DC1:RAC2
  7. 120.57.102.103=DC1:RAC2
  8. # datacenter Two
  9. 110.56.12.120=DC2:RAC1
  10. 110.50.13.201=DC2:RAC1
  11. 110.54.35.184=DC2:RAC1
  12. 50.33.23.120=DC2:RAC2
  13. 50.45.14.220=DC2:RAC2
  14. 50.17.10.203=DC2:RAC2
  15. # datacenter Three
  16. 172.106.12.120=DC3:RAC1
  17. 172.106.12.121=DC3:RAC1
  18. 172.106.12.122=DC3:RAC1
  19. # default for unknown nodes
  20. default =DC3:RAC1