Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

How is this possible? I dont understand

Server A ip=111.111.111.111
Server B ip=222.222.222.222

Server A:
ufw status 
23                         ALLOW       222.222.222.222
9160                       ALLOW       222.222.222.222
Anywhere                   ALLOW       222.222.222.222

Server A
telnet 127.0.0.1 9160
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.


On Server B
telnet 1111.111.111.111 9160
Trying 111.111.111.111...
telnet: Unable to connect to remote host: Connection refused

How is this possible? I me]an I have the port open for server B. This makes no sense.... Yes..a process is running on server A which is cassandra on 9160 demonstrated above with the telnet into 127.0.0.1

How can server B get a connection refused?

FYI...I have cassadra.yaml set the the public facing ip address.

Also on the cassandra server....its listing in 9160

lsof -i :9160
COMMAND   PID      USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
java    16593 cassandra   96u  IPv4 66540142      0t0  TCP ip6-localhost:9160 (LISTEN)

netstat -apn|grep -w 9160
tcp        0      0 127.0.0.1:9160          0.0.0.0:*               LISTEN      16593/java  
share|improve this question

closed as off-topic by MikeyB, Jenny D, Iain, dawud, mdpc Apr 15 at 17:21

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must demonstrate a minimal understanding of the problem being solved. Try including attempted solutions, why they didn't work, and the expected results. See How can I ask better questions on Server Fault? for further guidance." – MikeyB, Jenny D, Iain, dawud
If this question can be reworded to fit the rules in the help center, please edit the question.

    
Is the process listening on all IP addresses or only on loopback? –  Jenny D Apr 15 at 7:17
    
Please show the output of netstat -tnlp | grep :9160 –  Iain Apr 15 at 7:41
    
Ok so now you have a definitive answer to your question - it is as edvinas.me, jennyd and I said - your application is not listening on the external IP address. It should be easy to fix now. –  Iain Apr 15 at 7:53
    
Given that I have listen_address in cassandra.yaml set to the ip address of the machine...what else do I need to do? –  Tampa Apr 15 at 8:51
    
The answer already given was correct, according to the information you just posted here. Something is clearly wrong with your chef template and you need to go fix it. –  Michael Hampton Apr 16 at 5:13

2 Answers 2

Port is open, but Cassandra might be bound to 127.0.0.1 ip only. You have to make sure it is configured to be accessed via non 127.0.0.1 IP.

You need to set ListenAddress in cassandra.

share|improve this answer
    
One of many options, yes. OP should try telnet 111.111.111.111 9160 from A. Also, sudo netstat -ntpl on A. –  dmourati Apr 15 at 6:38
    
In cassandra I have the listen address set to the public facing ip address –  Tampa Apr 15 at 7:28
    
So do a netstat -apn|grep -w 9160 and post the results in your question. –  MadHatter Apr 15 at 7:30
    
I posted the netstat command –  Tampa Apr 15 at 7:49
1  
I stand correct, it is listening on 127.0.0.1 instead of public IP. Please set ListenAddress in cassandra. –  edvinas.me Apr 15 at 7:53

Connection Refused generally means that nothing is listening on the relevant port. Use netstat to confirm where the application is listening and take appropriate action.

share|improve this answer

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