Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My Cassandra used to work with no problems.

I was able to connect with no problems but now for some reason it doesn't work anymore.

[default@unknown] connect localhost/9160;
Exception connecting to localhost/9160. Reason: Connection refused.


root# ./bin/cassandra-cli -host localhost -port 9160
Exception connecting to localhost/9160. Reason: Connection refused.

I am on Linux Ubuntu Server.

Thanks in advance...

share|improve this question
Have your verified that the cassandra daemon is actually running? Find anything informative in its log files? – andol Jul 31 '11 at 14:51
Did you check to see if Cassandra is listening on port 9160: lsof -i :9160, netstat -nl | grep 9160, ...? – quanta Jul 31 '11 at 14:52
possible duplicate of What causes the 'Connection Refused' message? – Iain Sep 28 '15 at 18:24
up vote 3 down vote accepted

As others have already suggested make sure your cassandra instance is running

ps axu | grep cassandra

If the output tells you that it is running you can check what ports it is listening on:

netstat -tulpn | grep -i listen | grep <pid>

where is the process id of your cassandra instance which you can get from the output of the first command.

You are interested to find the port 9160 in the output of this command. You will know from this what address it is listening on (if for some reason it is no longer a localhost).

If for some reason you can't find 9160 port in the list of the listening sockets then you might want to check your cassandra.yaml config file (search for rpc_port). You will also find there the address where thrift binds to to listen for clients on.

share|improve this answer

By default Thrift is not up, you have to start it with

nodetool enablethrift
share|improve this answer
Can you add detail on how this answers the question or improves on the accepted answer? – Dave M Jan 11 at 13:54
We can use netstat -atn to check whether port 9160 is active or not. As given by Perry Cox we can execute nodetool enablethrift to enable Thrift communication. It was veryuseful for me to run kairosdb. – Siva Karthikeyan Feb 18 at 12:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.