snitch options use the
configuration file to determine which
datacenters and racks cluster
nodes belong to. Information about the network topology allows requests
to be routed efficiently and to distribute replicas evenly. The
following snitches can be configured here:
AWS EC2 single-region snitch
AWS EC2 multi-region snitch
The GossipingPropertyFileSnitch is recommended for production. This
snitch uses the datacenter and rack information configured in a local
cassandra-rackdc.properties file and propagates the information
to other nodes using
gossip. It is the default snitch and the settings
in this properties file are enabled.
The AWS EC2 snitches are configured for clusters in AWS. This snitch
cassandra-rackdc.properties options to designate 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.