Snitches

A snitch determines which datacenters and racks nodes belong to.

They inform Cassandra about the network topology so that requests are routed efficiently and allows Cassandra to distribute replicas by grouping machines into datacenters and racks. Specifically, the replication strategy places the replicas based on the information provided by the new snitch.

Switching snitches

GossipingPropertyFileSnitch

This snitch is recommended for production. It uses rack and datacenter information for the local node defined in the cassandra-rackdc.properties file and propagates this information to other nodes via gossip.

sudo vim /etc/cassandra/cassandra-rackdc.properties
# These properties are used with GossipingPropertyFileSnitch and will
# indicate the rack and dc for this node
dc=DC1
rack=RAC1

# Uncomment the following line to make this snitch prefer the internal ip when possible, as the Ec2MultiRegionSnitch does.
prefer_local=true

Change the snitch for each node in the cluster

sudo vim /etc/cassandra/cassandra.yaml
endpoint_snitch: GossipingPropertyFileSnitch

Restart each node one at a time

sudo service cassandra stop
sudo service cassandra start

results matching ""

    No results matching ""