1
votes

Here is one deployment scenario wherein NAT exists between DC boundaries, following are the requirements:

Cassandra Version: 2.1.13

  1. There are 2 DCs, two Cassandra nodes (dc1:node1 & dc2:node3) across DCs should communicate across NAT boundaries using public IP.
  2. One of the DC which is behind NAT has 2 Cassandra nodes (dc1:node1 and dc1:node2) and both them should communicate within NAT using private IP.
  3. All these 3 nodes (dc1:node1, dc1:node2 & dc2:node3) should form a ring and communicate with each other.

Looked into seeds, listen_address, broadcast_address & broadcast_rpc_address. https://docs.datastax.com/en/cassandra/2.1/cassandra/configuration/configCassandra_yaml_r.html

If there are public IPs used in broadcast_address and seeds then across DC & NAT communication works, however the nodes which are within NAT not able to detect each other.

If there are private IPs used in broadcast_address and seeds then within DC & NAT communication works, however the nodes across DC & NAT not able to detect each other.

Looked into Ec2MultiRegionSnitch but that will not work for premise deployments: https://docs.datastax.com/en/cassandra/2.1/cassandra/architecture/architectureSnitchEC2MultiRegion_c.html#architectureSnitchEC2MultiRegion_c__other-settings

What configuration settings will be required to achieve above 3 requirements?

2

2 Answers

3
votes

Use gossiping property file snitch, set public ip as broadcast_address and private ip as listen_address. They will use the listen_address in same DC and broadcast address if in other DC.

0
votes

Settings made with seeds=public address, listen_address=private and broadcast_address=public. With these settings made on all 3 nodes:

  • dc1:node1 & dc2:node3 works but
  • dc1:node1 and dc1:node2 doesn't

Is it because of seeds have public address within DC behind NAT might nor work?

One of the observation to check listen on dc1:node1, private IP is listed:

node1# netstat -anp | grep -E "(7001)" 
tcp 0 0 dc1:node1_privateIP:7001 0.0.0.0:* LISTEN 9999/java 

Can dc1:node2 establish connection with dc1:node1_publicIP? Is this https://issues.apache.org/jira/browse/CASSANDRA-9748 related here or will be only applicable in case of multiple NICS and not NAT environment?