Build Cloud-Native apps with Apache Cassandra

GOT QUESTIONS from the Workshop? You're in the right place! Post a question here and we'll get you answers.

Click here for Week 7 Materials and Homework.

Registrations still open!


question

dynamo3209_188769 avatar image
dynamo3209_188769 asked ·

"nodetool status" for the week 5 exercises gives "Failed to connect" errors

I setup 1node cluster for Ex.5, after logging into the pod with SSH on running nodetool status command from inside the pod I get this error

nodetool:failed to connect to 127.0.0.1:7199 - ConnectionException: connection refused.

Please let me know what is the issue.

Thanks,

Mohit

workshopcass-operator
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.

David Jones-Gilardi avatar image
David Jones-Gilardi answered ·

Usually you get that response if there is no node to connect to. Can you give more details or possibly a screenshot of what you are doing? What output do you get if you execute:

kubectl -n cass-operator get pods
4 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.

[Follow up question posted on #7327]

0 Likes 0 · ·

[Moved to #7327]

0 Likes 0 · ·
quinn.wong_194182 avatar image quinn.wong_194182 David Jones-Gilardi ♦ ·

[Follow up question posted on #7327]

0 Likes 0 · ·

Hi,

Thanks for the answers, yes the nodes took a little longer to start up because of limited resources. I have a 8gb laptop running Ubuntu.

Thanks,

Mohit

1 Like 1 · ·
Erick Ramirez avatar image
Erick Ramirez answered ·

To add to David's response, the error indicates that the pods are not fully operational (failed to start successfully).

You can check the status of your pods by running the following command:

$ kubectl -n cass-operator get pods

Here is an example output for a 3-pod cluster:

$ kubectl -n cass-operator get pods
NAME                             READY   STATUS    RESTARTS   AGE
cass-operator-56fcb9ff47-kb9lf   1/1     Running   0          6d15h
cluster1-dc1-default-sts-0       2/2     Running   0          6d15h
cluster1-dc1-default-sts-1       2/2     Running   0          6d15h
cluster1-dc1-default-sts-2       2/2     Running   0          6d15h

Note that if the value in the READY column is set to 1/2, it means that the Cassandra instance in that pod has not started successfully (for whatever reason).

If the C* instances have not started in the pod or if you ran into issues installing the cass-operator, you will not be able to connect to the Cassandra cluster via cqlsh.

In my experience, the most common cause is insufficient RAM on machines and Cassandra doesn't have enough resources to start successfully. We recommend that you only attempt running a 3-node cluster on machines which have at least 16GB of memory.

If you want to start over, you can delete your KiND cluster with the following command:

$ kind delete cluster --name kind-cassandra

For more info on deleting a KiND cluster or other basic Kubernetes commands, see the KiND Quick Start guide. 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.

Thanks for the additional information Erick. Yes, I only have 8GB of memory on my Mac so I'm guessing that I'm running up against that as the issue. Thanks again to you, David and the rest of the team for this awesome workshop!

2 Likes 2 · ·

You're very welcome! We really appreciate the feedback and thanks for joining our workshops. Cheers!

0 Likes 0 · ·