Scylla Snitches

Snitch determines which data centers and racks nodes belong to, Snitches inform Scylla about the network topology so that requests are routed efficiently and allows Scylla to distribute replicas by grouping machines into data centers and racks.

Scylla supports the following snitches:

SimpleSnitch

When working with single cluster deployments and all the nodes are under the same data-center use the SimpleSnitch, it binds all the nodes to the same Rack and data-center. This snitch is used in a single data-center deployments only.

RackInferringSnitch

Bind Nodes to DCs and Racks according to their Broadcast IPs:

For Example:

Node has a Broadcast IP 192.168.100.200, then it would belong to a DC ‘168’ and Rack ‘100’

GossipingPropertyFileSnitch

When working with multi-cluster deployments and the nodes are in various data-centers use the GossipingPropertyFileSnitch. Recommended to be used in production installations. It allows to explicitly define which DC and Rack a specific Node belongs to This snitch read its configuration from a cassandra-rackdc.properties file that located under /etc/scylla/

For Example:

prefer_local=true
dc=my_data_center
rack=my_rack

Set the prefer_local to true will tell Scylla to use local IP address. The local IP address is the listen_address parameter from the scylla.yaml file which is located under /etc/scylla/

Ec2Snitch

When working on EC2 with a single cluster deployments and all the nodes are under the same region use the Ec2Snitch. Basic snitch that reads its configuration from Amazon’s EC2 registry services. In EC2, the region name is treated as the datacenter name and availability zones are treated as racks within a datacenter. If the setup includes a single datacenter, there is no need to specify any parameters. Because private IPs are used, this snitch does not work across multiple regions.

If you working with multiple datacenters, set the parameter dc_suffix in the cassandra-rackdc.properties file under /etc/scylla/.

For Example:

Node 1 region DC 'us-west' and Rack Rack='1' will be us-west-1 dc_suffix= scylla_node_1

Node 2 region DC 'us-west' and Rack Rack='1' will be us-west-1 dc_suffix= scylla_node_2

us-west-1_scylla_node_1
us-west-1_scylla_node_2

Ec2MultiRegionSnitch

When working on EC2 using a multi-cluster deployments and the nodes are in various regions use the Ec2MultiRegionSnitch. Works like the Ec2Snitch, in addition, it set the broadcast_address and broadcast_rpc_address of a node to the node’s public IP. This would allow nodes from other zones to communicate with this node regardless of what is configured in the node’s scylla.yaml configuration file for broadcast_address and broadcast_rpc_address parameters.

Ec2MultiRegionSnitch also unconditionally imposes the “prefer local” policy on a node (similar to GossipingPropertyFileSnitch when prefer_local is set to true).

In EC2, the region name is treated as the datacenter name and availability zones are treated as racks within a datacenter.

To change the DC and Rack names do the following:

Edit the cassandra-rackdc.properties file with the preferred data-center name. The file can be found under /etc/scylla/ The dc_suffix defines a suffix added to the data-center name as described below.

For Example:

Node - region DC='us-west' and Rack Rack='1' will be us-west-1 dc_suffix= scylla_node_west

Node - region DC='us-east' and Rack Rack='2' will be us-east-2 dc_suffix= scylla_node_east

us-west-1_scylla_node_west
us-east-2_scylla_node_east

Getting Started