eguvenc avatar image
eguvenc asked Erick Ramirez edited

New installation, cqlsh returns "Unable to connect to any servers"

Hi all, I installed the latest cassandra by following instructions: i tried to set up under the Ubuntu 20.04

root@ubuntu-test:~# service cassandra status
● cassandra.service - LSB: distributed storage system for structured data
Loaded: loaded (/etc/init.d/cassandra; generated)
Active: active (exited) since Sat 2021-08-28 17:50:13 +03; 4min 26s ago
Docs: man:systemd-sysv-generator(8)

Service is active but when verify it i got below the errors

root@ubuntu-test:~# nodetool status
nodetool: Failed to connect to '' - ConnectException: 'Connection refused (Connection refused)'.
root@ubuntu-test:~# cqlsh
Connection error: ('Unable to connect to any servers', {'': ConnectionRefusedError(111, "Tried connecting to [('', 9042)]. Last error: Connection refused")})

Then i tried

vim /etc/cassandra/

and add to it this row

JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=localhost"

i restart the server but i got the same errors.

I don't do any changes in my cassandra config file it likes below.

listen_address: localhost
# seeds is actually a comma-delimited list of addresses.
# Ex: "<ip1>,<ip2>,<ip3>"
 - seeds: ""
# For security reasons, you should not expose this port to the internet. Firewall it if needed.
rpc_address: localhost

Help please i got still same errors.

1 comment
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

After i checked installation requirements i realized my resources is very low.

Hardware Choices | Apache Cassandra Documentation

0 Likes 0 ·

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered Erick Ramirez edited

There's a good chance that Cassandra is not running. You should review the logs for clues on the error.

You haven't provided a lot of information but I suspect you're using a new version Java. Cassandra 4.0 supports both Java 8 and Java 11. Earlier versions of Cassandra only worked with Java 8.

If you're new to Cassandra, have a look at our free learning resources at This short tutorial is a good starting point -- Cheers!

10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.