Sanket Goti
Sanket Goti

Reputation: 13

cqlsh "Unable to connect to any servers" on Windows installation

I installed Cassandra on Windows 10. When i trying to run cqlsh from /bin/,

I get the following error:

Connection error: ('Unable to connect to any servers', {'127.0.0.1': \
    error(10061, "Tried connecting to  [('127.0.0.1', 9042)].
Last error: No connection could be made because the target machine \
    actively refused it")})

I installed Cassandra from apache.org official site . also I get reference from https://phoenixnap.com/kb/install-cassandra-on-windows - Everything is looks good from the reference.

can anyone help me to solve this ? thanks in Advance.

Upvotes: 0

Views: 1582

Answers (2)

Erick Ramirez
Erick Ramirez

Reputation: 16303

The error states that cqlsh can't connect to the local Cassandra instance. The default configuration in conf/cassandra.yaml is for Cassandra to listen for CQL clients on localhost (127.0.0.1) and CQL port 9042:

native_transport_port: 9042
rpc_address: localhost

Since you're getting a "connection refused" error, the most likely issue is that Cassandra is not running on your Windows machine. Check the Cassandra logs (usually in logs/system.log) for errors which would provide clues as to why Cassandra couldn't start.

As a side note, there is very limited Windows support in Cassandra 3.x and there are several known issues that will not be fixed due to limitations in the operating system.

Furthermore, Windows support has been completely dropped in Cassandra 4.0 due to lack of maintainers and testing (CASSANDRA-16171).

As a workaround, we recommend the following:

If you just want to build apps with Cassandra as a backend, Astra DB has a free tier that lets you launch a Cassandra cluster in a few clicks with no credit card required. Cheers!

Upvotes: 1

Hades Architect
Hades Architect

Reputation: 153

Do you keep this terminal open and Cassandra runs when you are trying to connect? Notice you have to launch cqlsh from a different terminal window.

Instructions step 4

Please check the steps again, mostly probably Cassandra simply doesn't run. Keep attention on the p.4 specially.

Upvotes: 0

Related Questions