1

I have installed cassandra but not able to connect to cassandra server from remote ip..

[root@li1632-39 ~]# cassandra -v
3.0.9

I and connecting public_ip:9042 but connection refused. When I try to validate by telnet I can see port is closed. When I try to check the status of cassandra its running.

[root@li1636-25 ~]# nodetool status
Datacenter: singapore
=====================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address          Load       Tokens       Owns (effective)  Host ID                               Rack
UN  192.168.130.104  297.48 KB  256          100.0%            85bebb4d-4ce9-4144-b33a-8e9759a87e54  rack5
UN  192.168.130.59   262.73 KB  256          100.0%            f79f1c04-b567-4e15-98f0-5fd1a8345f61  rack5

I have cassandra.yaml

listen_address: 192.168.130.59
rpc_address: 192.168.130.59
start_rpc: true

I have also tried with cassandra.yaml

listen_address: 0.0.0.0
rpc_address: 0.0.0.0
start_rpc: true

In this case I am getting below error.

[root@li1636-25 ~]# nodetool status
nodetool: Failed to connect to '127.0.0.1:7199' - ConnectException: 'Connection refused (Connection refused)'.

Error from the remote host on telnet.

A-MacBook-Air:~ ads$ telnet public_ip 9042
Trying 172.104.52.39...
telnet: connect to address public_ip: Connection refused
telnet: Unable to connect to remote host

Below is the result of Netstat

netstat -tulpn | grep LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      3575/sshd           
tcp        0      0 192.168.130.59:7000     0.0.0.0:*               LISTEN      6777/java           
tcp        0      0 127.0.0.1:7199          0.0.0.0:*               LISTEN      6777/java           
tcp        0      0 127.0.0.1:37857         0.0.0.0:*               LISTEN      6777/java           
tcp        0      0 192.168.130.59:9160     0.0.0.0:*               LISTEN      6777/java           
tcp6       0      0 192.168.130.59:9042     :::*                    LISTEN      6777/java           
tcp6       0      0 :::22                   :::*                    LISTEN      3575/sshd  

I have stopped Firewalld also.

Ranjeet Ranjan
  • 921
  • 2
  • 10
  • 21
  • `192.168.130.104` is an rfc1918 private address, is there some form of port forwarding/natting in front of that computer? And, if so, is it properly configured? – fvu Mar 14 '17 at 21:50
  • There is no port forwarding/natting. – Ranjeet Ranjan Mar 14 '17 at 21:56
  • 1
    If you only listen on a private address, and there's no natting in front of that, you're not listening on an interface with access to the outside world. – fvu Mar 14 '17 at 21:57
  • I am sorry for misunderstanding. Yes there is port forwarding/natting. I cannot tell you the eject situation as I am using Linode Cloud service. I have also tried with public ip but did not worked. – Ranjeet Ranjan Mar 14 '17 at 22:00
  • 1
    Well, as long as you're not certain about the actual network topology it's pretty hard to say something useful... [This](http://stackoverflow.com/questions/27758795/cant-connect-to-cassandra-node-from-different-host) may help – fvu Mar 14 '17 at 22:07
  • I have already tried but did not worked. You can check in the question I have explained. ALso I would like to say I have tried with public and private ip but but non of them worked. – Ranjeet Ranjan Mar 14 '17 at 22:09
  • If you have used the public IP have you checked that iptables is allowing connections to port 9042? – mikea Mar 15 '17 at 13:11
  • I have already stopped firewall. In the meantime I would to say when I deploy my application in another node it get connection successfully with private IP. But still I am not able to connect from our office IP. – Ranjeet Ranjan Mar 15 '17 at 18:20

0 Answers0