0
votes

C:\Users\spant2\Downloads\apache-cassandra-3.11.5\bin>cassandra -f

Starting Cassandra Server

C:\Users\spant2\Downloads\apache-cassandra-3.11.5\bin>cqlsh

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")})

2
Please show us some of your code and have a look at How do I ask a good question?. - Spark Fountain
please edit your question and add the command that you are using to connect to Cassandra - abi_pat
@abi_pat I updated the commands. Can you please suggest? - Shubhangi Pant
is your cassandra node running on same host? - abi_pat
based on your question, I am assuming your cassandra node is running on same machine/host. Refer docs.datastax.com/en/archived/cql/3.3/cql/cql_reference/… and mention host port parameters. If you still face the issue, I think you may need to update your hosts file - howtogeek.com/howto/27350/… - abi_pat

2 Answers

1
votes

can you check if any other process/application is running on port 9042

linux command

netstat -anp|grep -i 9042

if any process is already running on same port, kill that process.

0
votes

Please use cqlsh with IP address if you set rpc_address is public IP.

You may refer below https://docs.datastax.com/en/archived/cql/3.3/cql/cql_reference/cqlsh.html

Also, please check whether port 9042 is open or not on your system.