satyendra paterya
unread,Dec 21, 2021, 6:15:29 AM12/21/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DataStax Java Driver for Apache Cassandra User Mailing List, bret.m...@datastax.com, java-dri...@lists.datastax.com, Satyendra Paterya
Hi,
As you suggested try the 4.x java driver, I have observed following things with this driver.
Case 1. When I connected to Cassandra cluster (that is deployed in k8s env) with 4.x java driver, Driver session does not provide the node information -
For example-
Code snipped:
CqlSession session = null;
String podServiceAddress = "
cassandra-database-service.namespace.svc.cluster.local";
CqlSessionBuilder builder = CqlSession.builder();
builder.addContactPoint(new InetSocketAddress(podServiceAddress, 9042));
builder.withLocalDatacenter("dc1");
//builder.withNodeStateListener(new CassandraNodeListner());
session = builder.build(
Metadata metadata = session.getMetadata();
Map<UUID, Node> map = metadata.getNodes();
Output of the Print Statement:-
Details Node node_state=> UNKNOWN EndPoint=> <Pod-1-IP>:9042 BroadCastAddress=> Optional[/<Pod-1-IP>:0]
Details Node node_state=> UP EndPoints=>cassandra-database-service.namespace.svc.cluster.local/<Pod-2-IP>:9042 BroadCastAddress=> Optional[/<Pod-2-IP>:0]
Details Node node_state=> UNKNOWN EndPoints=> /<Pod-3-IP>:9042 BroadCastAddress=> Optional[/<Pod-3-IP>:0]
Case 2. If we delete Cassandra pod-
When we delete the pod which is highlighted in green color then driver does not receive any notification in k8s env. I means to say that node state does not getting updated when pod goes down.
Please help me for the same.
I am doing this because of to check the Cassandra nodes status.
//Thanks
Satyendra Paterya