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

ranjeet_ranjee avatar image
ranjeet_ranjee asked ·

Error while opening new channel

Hi,

I have 3 node cluster as per the below details

Datacenter: Cassandra
==========
Address        Rack        Status State   Load            Owns                Token                                       
                                                                              -1661127279954241273                        
private_ip_node1  rack1       Up     Normal  794.5 GiB       81.39%              -8793923813552797403                        
private_ip_node2  rack1       Up     Normal  887.03 GiB      79.94%              -5361369451575398440                        
private_ip_node_3 rack1       Up     Normal  437.49 GiB      38.67%              -1661127279954241273                        


Config File


seed_provider:
    # multiple nodes!
    - class_name: org.apache.cassandra.locator.SimpleSeedProvider
      parameters:
          # seeds is actually a comma-delimited list of addresses.
          # Ex: "<ip1>,<ip2>,<ip3>"
          - seeds: "private_ip_node_1,private_ip_node_3,private_ip_node_3"
listen_address: Node Private IP
listen_on_broadcast_address: true
start_native_transport: true
native_transport_port: 9042
native_transport_allow_older_protocols: true
native_transport_address: 0.0.0.0
native_transport_broadcast_address: Node Public IP
native_transport_keepalive: true

Recently we have moved our microservice from node-based to container-based K8 but getting some warning.

1)

2021-06-18 11:53:42.735  WARN 1 --- [     s0-admin-0] c.d.o.d.i.c.l.h.OptionalLocalDcHelper    : [s0|default] You specified Cassandra as the local DC, but some contact points are from a different DC: Node(endPoint=/private_ip_node_3:9042, hostId=null, hashCode=64489a24)=null; please provide the correct local DC, or check your contact points

2)

2021-06-18 11:53:47.832  WARN 1 --- [     s0-admin-1] c.d.o.d.internal.core.pool.ChannelPool   : [s0|/public_ip_node_3:9042]  Error while opening new channel (ConnectionInitException: [s0|connecting...] Protocol initialization request, step 1 (STARTUP {CQL_VERSION=3.0.0, DRIVER_NAME=DataStax Java driver for Apache Cassandra(R), DRIVER_VERSION=4.6.1, CLIENT_ID=9ead6257-6803-4d94-9632-a4e203419391}): failed to send request (java.nio.channels.NotYetConnectedException))

2021-06-18 11:53:47.836  WARN 1 --- [     s0-admin-0] c.d.o.d.internal.core.pool.ChannelPool   : [s0|/public_ip_node_2:9042]  Error while opening new channel (ConnectionInitException: [s0|connecting...] Protocol initialization request, step 1 (STARTUP {CQL_VERSION=3.0.0, DRIVER_NAME=DataStax Java driver for Apache Cassandra(R), DRIVER_VERSION=4.6.1, CLIENT_ID=9ead6257-6803-4d94-9632-a4e203419391}): failed to send request (java.nio.channels.NotYetConnectedException))


Application Connection

            keyspace = "keyspace_name"
            session = CqlSession
                    .builder()
                    .withLocalDatacenter("Cassandra")
                    .addContactPoints(
                            [new InetSocketAddress("private_ip_node_1", 9042),
                             new InetSocketAddress("private_ip_node_2", 9042)])
                    .withAuthCredentials("username","password")
                    .withKeyspace(keyspace)
                    .build()


DSE Version: 6.8.4
DRIVER_VERSION=4.6.1

We are not getting any issues while saving data to Cassandra except for this warning message.


We are not getting any warning message when the same microservice is deployed directly on the node.

Our Pod Node and Direct node are in the same VPC range.

Looking forward to your answer.

dse
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 ·

Apps will not be able to connect to the Cassandra pods from outside the Kubernetes cluster because pods are in an isolated network.

You will need to expose the pods to the "outside world" using a Kubernetes service such as Ingress or Nodeport. Cheers!

2 comments 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.

Hi Erick, I have updated the question.

0 Likes 0 ·

@Erick Ramirez I think you misunderstood. My DSE cluster is not inside the K8s. Its outside the K8s. Our microservice is inside the K8s in the same VPC as of DSE cluster.

0 Likes 0 ·