Database Reference
In-Depth Information
10. The first octet has no special meaning.
20. The second octet is the data center octet. If there was another node at
10.30.40.1, Cassandra would assume that this node was in a different
physical data center.
30. The third octet is the rack octet. Cassandra assumes that all nodes in this
octet are in the same rack.
40. The final octet is the node octet.
When defining your keyspace strategy_options , be sure to include the
second octet as the data center name for clarity.
EC2
The Ec2Snitch is for Amazon Web Services (AWS)-based deployments where the
entire cluster sits within a single region. The region is then considered the data
center and the availability zones are considered the racks in those data centers. For
example, let's assume you have a cluster set up in the us-east-1 region. If node1 is
in us-east-1a and node2 is in us-east-1b, Cassandra would consider these nodes to
be in two different racks within the same data center. Node1 would be considered
rack 1a and node2 would be considered rack 1b.
Since the Ec2Snitch will work only in single-region deployments, you don't
have to worry about public IPs for the Cassandra nodes. It also makes your key-
space definition more straightforward. When defining the strategy_options
for your keyspace, the EC2 region name (which was us-east in the preceding ex-
ample) is what should be used as the data center name. Listing 5.1 shows an ex-
ample of how to create a keyspace using the Ec2Snitch in the us-east data center.
Listing 5.1 Keyspace Creation for the Ec2Snitch in the us-east Data Center
Click here to view code image
CREATE KEYSPACE VideoStore
WITH replication = {'class': 'NetworkTopo-
logyStrategy', 'us-east' : 3}
AND durable_writes = true;
 
Search WWH ::




Custom Search