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

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: https://cassandra.apache.org/_/download.htmlthen 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 '127.0.0.1:7199' - ConnectException: 'Connection refused (Connection refused)'.
root@ubuntu-test:~# cqlsh
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")})

Then i tried

vim /etc/cassandra/cassandra-env.sh

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
seed_provider:
# seeds is actually a comma-delimited list of addresses.
# Ex: "<ip1>,<ip2>,<ip3>"
 - seeds: "127.0.0.1:7000"
# 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.

installation
1 comment
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.

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 datastax.com.dev. This short tutorial is a good starting point -- https://www.datastax.com/try-it-out. Cheers!

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.