Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

a.gheshlaghy_177282 avatar image
a.gheshlaghy_177282 asked ·

Is it possible for the Java driver to pick the private address of a node?

Hi,

i was testing multiple NIC for public and private address in test environment, and configure my nodes according to https://docs.datastax.com/en/dse/6.8/dse-admin/datastax_enterprise/config/configMultiNetworks.html guides.
i had question about below java-driver:

https://docs.datastax.com/en/developer/java-driver-dse/1.6/manual/address_resolution/

could client get private address (which is set for listen_address)?
what happens if they get private address instead of public address since they may not have route to dse private NIC.

dsejava driver
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

No, it isn't possible for the Java driver to pick the private IP address unless (a) you've explicitly configured rpc_address to use the private IP (native_transport_address in DSE 6.x), or (b) you did not set rpc_address. You should set the RPC address to an IP which is routable from the application servers and is usually the public IP address.

The Java driver will connect to the broadcast RPC address (broadcast_rpc_address or native_transport_broadcast_address in DSE 6.x) which defaults to rpc_address (native_transport_address in DSE 6.x). This is the public interface where the CQL client port (default is 9042) is bound to.

NOTE: The rpc_* properties in cassandra.yaml were deprecated and renamed to native_transport_* in DSE 6.0 (DB-1130). Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.