1

I have downloaded the tar binary file and created a cluster with 3 nodes. When running bin/nodetool status all the nodes are UN running and when connecting to bin/cqlsh it was throwing an error as listed below:

Connection error: ('Unable to connect to any servers', {'127.0.0.1:9042': ConnectionRefusedError(111, "Tried connecting to [('127.0.0.1', 9042)]. \
Last error: Connection refused")})

The below error is from the logs:

ERROR [HintsWriteExecutor:1] 2023-06-14 11:40:25,242 HintsCatalog.java:167 - Unable to open directory /home/........../apache-cassandra-4.0.10/bin/../data/hints

2 Answers 2

1

I see two issues here.

One -

when connecting to bin/cqlsh it was throwing and error as listed below

Tried connecting to [('127.0.0.1', 9042)]

Curious, but are any of the nodes actually running on localhost (127.0.0.1)? This should be viewable from the output of the nodetool status command. Try running bin/cqlsh while passing one of the bound IP addresses. Ex:

bin/cqlsh 10.4.34.2 -u yourusername -p yourpassword

Two -

ERROR [HintsWriteExecutor:1] 2023-06-14 11:40:25,242
    HintsCatalog.java:167 - Unable to open directory 
    /home/........../apache-cassandra-4.0.10/bin/../data/hints

Which user is Cassandra running as? Does it have the correct permission to write to the data/hints/ directory? I am guessing not.

0

The error Connection refused indicates that there is no process listening for connections on IP 127.0.0.1 on port 9042.

When you run cqlsh without any arguments, it will connect to localhost by default.

Since you have deployed a 3-node cluster, that would indicate to me that you have configured each node to use an IP address that is publicly accessible instead of localhost.

You need to specify the host using the same address as you configured for rpc_address in cassandra.yaml. For example:

$ bin/cqlsh 10.1.2.3

Note that cqlsh will connect to the default CQL port 9042. If you have configured a different native_transport_port in cassandra.yaml, you also need to specify the port when connecting to your cluster. For example:

$ bin/cqlsh 10.1.2.3 9123

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.