1
votes

I am new to cassandra database.if my cassandra version is 2.2.12 at that place cqlsh is working without any issues and it is connected.

after i updated my cassandra db 3.11.2 version, cqlsh is not connected throwing error

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

after again i Downgrade my cassandra version cqlsh is working. here why my latest cassandra cqlsh is not working.

Please help me, Thank you

1
You need to check that your Cassandra is actually started... Check your logs for detailsAlex Ott
@AlexOtt ya cassandra is already started but its simply throwing above error.user7888596
Are you sure that it's running? It could start, but then finish its work - this happens quite often when it finds a problem reading some files. Check system.log for details. Or it doesn't listen on localhost interface...Alex Ott
cassandra running status is Active: active (exited) . i don't know why its coming like this. even i checked cassandra.yml file. but my issue is not resolved.user7888596
Check lines above, especially with ERROR log levelAlex Ott

1 Answers

0
votes

Ran the netstat command and got the following output: below command is working for me check it once.

netstat -an | grep 9042 tcp 0 0 ::ffff:10.1.22.10:9042 :::* LISTEN The above output indicated that we are listening on port 9042 and IP address 10.1.22.10.

However, the error clearly showed that cqlsh was trying to connect to 127.0.0.1 by default. So we were getting "connection refused" error.

Modified the cqlsh command to connect to the IP address 10.1.22.10 and re-ran it as follows and we were able to connect to Cassandra database successfully.