Error: Failed to connect to ’127.0.0.1:7199′: Connection refused (Cassandra) [SOLVED]

Error While Using Cassandra’s ‘nodetool’


This error may occur when using the ‘nodetool’ command, such as in the following example:

nodetool status


For both CentOS 6 and CentOS 7 search the following configuration file:

vim /etc/cassandra/default.conf/cassandra-env.sh


Search for:

JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=


Which for my search resulted in:

# add this if you’re having trouble connecting:
# JVM_OPTS=”$JVM_OPTS -Djava.rmi.server.hostname=<public name>”


Uncomment the second line, and add the hostname of your server, or the IP address which you’re connecting to/from. In this case, replacing <public name> with 127.0.0.1 resolved the issue, because I am connecting to/from that IP address.


Then exit and save the file with the command :wq .


Be sure to restart Cassandra:

systemctl restart cassandra

  • 49 Users Found This Useful
Was this answer helpful?

Related Articles

How To List and Attach to Docker Containers

List Containers First we’ll list which containers we have running: docker ps Your result...

How to List Which Apache 2 Modules are Enabled on Fedora 21

The Apache web server is one of the most popular and powerful web servers in the world due to its...

What is an SPF Record?

An SPF (Sender Policy Framework) record is a list of servers that are allowed to send e-mail from...

How to Install ProFTPD on CentOS 6

Step 1: Add the EPEL Repository ProFTPD is part of Extra Packages for Enterprise Linux (EPEL),...

How to Display (List) All Jobs in Cron / Crontab

Servers can automatically perform tasks that you would otherwise have to perform yourself, such...

Powered by WHMCompleteSolution