title: Why am I seeing "Nodetool status connection refused"?
body: <p>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.</p>
  
  <p>I've heard that I should change the cassanda-env.sh to include the hostname, which I have done here;</p>
  
  <pre><code># add this if you're having trouble connecting:
  JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=localhost"
  </code></pre>
  
  <p>However when I run <code>nodetool status</code></p>
  
  <p>I get </p>
  
  <pre><code>nodetool: Failed to connect to '127.0.0.1:7199' - ConnectException: 'Connection refused (Connection refused)'.
  </code></pre>
  
  <p>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.</p>
  
  <p>I can ping localhost just fine;</p>
  
  <pre><code>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
  </code></pre>
  
  <p>And Cassandra is definitely running</p>
  
  <pre><code>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.
  </code></pre>
  
  <p>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.</p>
  
  <p>Any help would be greatly appreciated, thanks</p>
  
  <p>Debug log after restart
  <a href="https://gist.github.com/anonymous/263e1ee09d95dc761abaf39d8d3bcb1f" rel="nofollow noreferrer">https://gist.github.com/anonymous/263e1ee09d95dc761abaf39d8d3bcb1f</a></p>