I'm not 100% sure, but it's worth trying to disable the token metadata
<https://docs.datastax.com/en/developer/java-driver/4.2/manual/core/metadata/token/#enabling-disabling>,
because the driver needs to read the "system.peers_v2" table for
populating the token metadata.
On 11/10/2023 19:15, Regis Le Bretonnic wrote:
Hi (also posted in dev mailing list but not sure I can publish on it),
We use datastax cassandra java driver v4.15.0 and we want to limit connexion
only to Cassandra proxy nodes (Nodes with no data started with option:
-Dcassandra.join_ring=false).
For that:
- we configured the driver to have only proxy hosts in the contact-points
(datastax-java-driver.basic.contact-points).
- we added a custom configuration containing "whitelisted host" (same list as
contact-points)
- we implemented a custom NodeFilter Class to limit allowed nodes to
whitelisted one
If we look at opened TCP connexions between client and Cassandra cluster we see
only 2:
- one to one of the proxy listed in the contact-points (coordinator connexion)
- another one the the same proxy (query connexion)
We expected to have an opened connexion to each proxy listed in contact-points
/ whitelisted hosts.
We found that it is not the case because during cluster discovery the driver execute a query in
table "system.peers" or "system.peers_v2" (made in DefaultTopologyMonitor
class) and proxy nodes are not in this table.
Why are proxy nodes lot listed in system.peers and why the discovery checks in this table
? Is it possible to bypass this control or add these nodes in table "peers" ?
Is there a way to implement a custom version of TopologyMonitor interface to
bypass this mechanism ?
Is there another way to do this ?
Thanks in advance
Regards