Is Cassandra java driver 3.0.1 is supported in Kubernetes.

48 views
Skip to first unread message

satyendra paterya

unread,
Dec 14, 2021, 6:52:38 AM12/14/21
to java-dri...@lists.datastax.com
Hi,

We have deployed cassandra(3.11.2) on k8s environment   and tried to connect with java-drive(3.0.1), Driver is not sending any notification regarding whether the pod is down to the Cluster object. Is Cassandra driver behaviour different in k8s env or another version is supported with this feature?

//Thanks
Satyendra Paterya

satyendra paterya

unread,
Dec 14, 2021, 6:54:23 AM12/14/21
to java-dri...@lists.datastax.com

Bret McGuire

unread,
Dec 14, 2021, 1:20:51 PM12/14/21
to DataStax Java Driver for Apache Cassandra User Mailing List, skpa...@gmail.com
   Hey Satyendra, thanks for your question!

   I'm wondering if you're running into some of the problems that led to JAVA-1522.  Are you able to try out one of the 4.x drivers and see if you get better results?

   Thanks again!

    - Bret -

satyendra paterya

unread,
Dec 21, 2021, 6:15:29 AM12/21/21
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
Reply all
Reply to author
Forward
0 new messages