Database Reference
In-Depth Information
tion or removal of the node.
GossipingPropertyFileSnitch
is there to solve this
problem. This snitch uses the gossip mechanism to propagate the information about the
node's location.
In each node, you put a file named
cassandra-rackdc.properties
under the
conf
directory. This file contains two components, the names of the node's data center
and rack expressed as follows:
dc=DC3
rack=RAC2
RackInferringSnitch
If
SimpleSnitch
is one end of the spectrum, where a snitch does not assume anything,
RackInferringSnitch
is the other extreme of the spectrum.
RackInferringSn-
itch
uses an IP address to guess the data center and rack of a node. It assumes that the
second octet of the IP address uniquely denotes a data center, and the third octet uniquely
represents a rack within a data center. Thus, for
10.110.6.30
,
10.110.6.4
,
10.110.2.42
, and
10.108.10.1
, this snitch assumes that the first two nodes reside
in the same data center and in the same rack, while the third node lives in the same data
center but in a different rack. It assumes that the fourth node exists in a different data cen-
ter than the rest of the nodes in the example:
+---------> Data center
| +------> Rack
| |
10.110.6.30
This can be dangerous to use if your machines do not use this pattern for IP assignment to
the machines in data centers.
EC2Snitch
Ec2Snitch
is a snitch specially written for Amazon AWS installations. It uses the
node's local metadata to get its availability zone and then breaks it into pieces to determ-
ine the rack and data center. Note that the rack and data center determined in this way do
not correspond to the physical location of hardware in Amazon's cloud facility, but this
approach gives a pretty nice abstraction.