Database Reference
In-Depth Information
determined to be in the same rack. “Determined to be” really means that Cassandra has to guess
based on an assumption of how your servers are located in different VLANs or subnets.
NOTE
Simple Snitch was renamed in 0.7; prior to that it was called endpoint snitch.
You configure which endpoint snitch implementation to use by updating the value for the
<EndPointSnitch> element in the configuration file. The other choice is the PropertyFileSn-
itch .
PropertyFileSnitch
The org.apache.cassandra.locator.PropertyFileSnitch used to be in contrib , but
was moved into the main code base in 0.7. This snitch allows you more control when using a
Rack-Aware Strategy by specifying node locations in a standard key/value properties file called
cassandra-rack.properties.
This snitch was contributed by Digg, which uses Cassandra and regularly contributes to its de-
velopment. This snitch helps Cassandra know for certain if two IPs are in the same data center
or on the same rack—because you tell it that they are. This is perhaps most useful if you move
servers a lot, as operations often need to, or if you have inherited an unwieldy IP scheme.
The default configuration of cassandra-rack.propertieslooks like this:
# Cassandra Node IP=Data Center:Rack
10.0.0.10=DC1:RAC1
10.0.0.11=DC1:RAC1
10.0.0.12=DC1:RAC2
10.20.114.10=DC2:RAC1
10.20.114.11=DC2:RAC1
10.20.114.15=DC2:RAC2
# default for unknown nodes
default=DC1:r1
Here we see that there are two data centers, each with two racks. Cassandra can determine an
even distribution with good performance.
Update the values in this file to record each node in your cluster to specify which rack contains
the node with that IP and which data center it's in. Although this may seem difficult to maintain
if you expect to add or remove nodes with some frequency, remember that it's one alternative,
Search WWH ::




Custom Search