@@ -139,8 +139,8 @@ proxy, we have an option to use `FixedHostNameAddressTranslator`. But for multi-
139
139
want to have more control over routing queries to a specific datacenter (eg. for optimizing latencies), which requires
140
140
setting up a separate proxy per datacenter.
141
141
142
- Normally, each Cassandra datacenter nodes are deployed to a separate subnet to support internode communications in the
143
- cluster and avoid IP addresses collisions. So when Cassandra broadcasts its nodes IP addresses, we can determine which
142
+ Normally, each Cassandra datacenter nodes are deployed to a different subnet to support internode communications in the
143
+ cluster and avoid IP address collisions. So when Cassandra broadcasts its nodes IP addresses, we can determine which
144
144
datacenter that node belongs to by checking its IP address against the given datacenter subnet.
145
145
146
146
For such scenarios you can use ` SubnetAddressTranslator ` to translate node IPs to the datacenter proxy address
@@ -152,13 +152,15 @@ datastax-java-driver.advanced.address-translator {
152
152
class = SubnetAddressTranslator
153
153
subnet-addresses {
154
154
"100.64.0.0/15" = "cassandra.datacenter1.com:9042"
155
- "100.66.0.0/15" = "cassandra.datacenter2.com" # port defaults to 9042 if not specified
155
+ "100.66.0.0/15" = "cassandra.datacenter2.com: 9042"
156
156
# IPv6 example:
157
157
# "::ffff:6440:0/111" = "cassandra.datacenter1.com:9042"
158
- # "::ffff:6442:0/111" = "cassandra.datacenter2.com" # port defaults to 9042 if not specified
158
+ # "::ffff:6442:0/111" = "cassandra.datacenter2.com: 9042"
159
159
}
160
- # Optional. When configured, addresses not matching the configured subnets are translated to it. Port defaults to 9042 if not specified .
160
+ # Optional. When configured, addresses not matching the configured subnets are translated to this address .
161
161
default-address = "cassandra.datacenter1.com:9042"
162
+ # Note: `advanced.resolve-contact-points` is used to determine whether to resolve subnet and default address
163
+ # on translation.
162
164
}
163
165
```
164
166
0 commit comments