Database Reference
In-Depth Information
ation file,
cassandra-topology.properties
, which can be found under the
conf
directory (for a tarball installation, it is
<installation>/conf
; for repository
installations, it is
/etc/cassandra
). Note that if you are using
PropertyFileSn-
itch
, all the nodes must have an identical topology file.
The
cassandra-topology.properties
file is a standard properties file with keys
as the IP address of the node and values expressed as
<data-center-
name>:<rack-name>
. It is up to you what data center name and what rack name you
give. Two nodes with the same data center name will be treated as nodes within a single
data center. Two nodes with the same data center name and rack name combination will
be treated as two nodes on the same rack.
Here is an example topology file:
# Cassandra Node IP=Data Center:Rack
# Data-center 1
10.110.6.30=DC1:RAC1
10.110.6.11=DC1:RAC1
10.110.4.30=DC1:RAC2
# Data-center 2
10.120.8.10=DC2:RAC1
10.120.8.11=DC2:RAC1
# Data-center 3
10.130.1.13=DC3:RAC1
10.130.2.10=DC3:RAC2
# default for unknown nodes
default=DC1:RAC0
DCX and RACX are commonly used patterns to denote a data center and a rack, respect-
ively. Nevertheless, you are free to choose anything that suits you. The default option is to
take care of any node that is not listed in
PropertyFileSnitch
.
GossipingPropertyFileSnitch
Even with all the fancy naming and grouping, one thing that is a nuance in
Proper-
tyFileSnitch
is the manual effort to keep the topology files updated with every addi-