Database Reference
In-Depth Information
Ec2MultiRegion
The Ec2MultiRegionSnitch is for use in Amazon Web Services deployments
where the Cassandra cluster spans multiple regions. This snitch views data centers
and racks in a similar fashion to the EcC2Snitch. Using the Ec2MultiRegionSn-
itch, if a node is us-east-1a, us-east is the data center and 1a is the rack name.
The major difference is in setting the IP addresses. The Ec2MultiRegionSnitch
requires the use of public IPs to be able to talk across regions. When configuring
your node, the listen_address is still set to the private IP of the node. The
broadcast_address is set to the public IP address of the node. This allows
nodes in different regions to communicate. If Cassandra determines that the nodes
are within the same data center, it will switch to using the private IP address
of the node, the one that was set as the listen_address , when doing intra-
availability-zone communication.
There are a few other important settings that need to be changed in order to
make use of the Ec2MultiRegionSnitch. The seed nodes that are set in the cas-
sandra.yaml file must be the public IPs of the seed machines. Since private IPs are
not routable, public IPs need to be used in order to get to the nodes that will initiate
the bootstrap. The storage_port , default 7000 (or ssl_storage_port ,
default 7001), should be accessible to all the nodes in the cluster. This may require
adjusting the security group settings. The keyspace creation with regard to data
centers should be handled in the same fashion as the Ec2Snitch. Listing 5.2 shows
an example of how to create a keyspace using the Ec2MultiRegionSnitch in the
us-east and us-west data centers. Each data center is being set up with a replication
factor of 3.
Listing 5.2 Keyspace Creation for the Ec2MultiRegionSnitch in the us-east
and us-west Data Centers
Click here to view code image
CREATE KEYSPACE VideoStore
WITH replication = {'class': 'NetworkTopo-
logyStrategy', 'us-east' : 3, 'us-west': 3 }
AND durable_writes = true;
 
Search WWH ::




Custom Search