Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I seeing "Nodetool status connection refused"?

I've installed Cassandra via a service on an EC2 instance running Ubuntu 16, and I can't, for the life of me, understand why I can't get nodetool status working.

I've heard that I should change the cassanda-env.sh to include the hostname, which I have done here;

# add this if you're having trouble connecting:
JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=localhost"

However when I run nodetool status

I get

nodetool: Failed to connect to '127.0.0.1:7199' - ConnectException: 'Connection refused (Connection refused)'.

I've checked my security group, and I allow all traffic from anywhere and everywhere, I've even added a custom TCP rule to allow traffic for port 7199 and I still get connection refused.

I can ping localhost just fine;

PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.033 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.011 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.013 ms

And Cassandra is definitely running

ubuntu@ip-172-31-20-215:~$ sudo service cassandra status
● cassandra.service - LSB: distributed storage system for structured data
   Loaded: loaded (/etc/init.d/cassandra; bad; vendor preset: enabled)
   Active: active (exited) since Sun 2017-05-07 05:27:10 UTC; 2min 13s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 30370 ExecStop=/etc/init.d/cassandra stop (code=exited, status=0/SUCCESS)
  Process: 30521 ExecStart=/etc/init.d/cassandra start (code=exited, status=0/SUCCESS)

May 07 05:27:10 ip-172-31-20-215 systemd[1]: Starting LSB: distributed storage system for structured data...
May 07 05:27:10 ip-172-31-20-215 systemd[1]: Started LSB: distributed storage system for structured data.

I' not sure what more I can do, i've tried setting the host to another interface, however I still get the same problem. I don't even have IPtables installed so I really don't think it's a firewall issue.

Any help would be greatly appreciated, thanks

Debug log after restart https://gist.github.com/anonymous/263e1ee09d95dc761abaf39d8d3bcb1f

like image 514
Cherona Avatar asked May 07 '17 05:05

Cherona


3 Answers

Turns out, you can't run Cassandra on a VPS with 512MB of RAM, you'll need at least 2GB, even with single-node cluster.

Cassandra was stopping seconds after starting, and I couldn't nodetool status because it wasn't running.

like image 169
Cherona Avatar answered Oct 24 '22 11:10

Cherona


It's a RAM issue, I faced same today and solved the problem after changing EC2 instance type to Medium.

like image 29
sudip saha Avatar answered Oct 24 '22 11:10

sudip saha


  1. Get rid of this line: JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=localhost"
  2. Try restart the service: sudo service cassandra restart
  3. If you have a cluster, make sure that ports 7000 and 9042 are open within your security group.
like image 22
nevsv Avatar answered Oct 24 '22 10:10

nevsv