Reputation: 564
I've installed cassandra on 3 AWS EC2 instances but none of them can ping each other neither do telnet on 7000.
telnet tm1 7000
Trying 172.31.30.37...
telnet: Unable to connect to remote host: Connection timed out
Below is the output for netstat
netstat -na|grep LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN
I understand for cassandra inter node communication i need to have 7000 port open but wondering how can i make it listen on ubuntu.
Any help would be appreciated !
Upvotes: 0
Views: 673
Reputation: 2158
Ok so you're testing TCP communication for port 7000
here, but this could be any port really. The first thing you need to do is setup a process to listen on a port and then test the connection (a TCP socket must first be opened before you can test connectivity to it).
You can use netcat
(nc
) which is an ideal tool to check this. Ensure you have it installed first then you can run up a "server" to bind to a port like so:
nc -l 0.0.0.0 7000
Then you can check to make sure its listening
$ netstat -lnt | awk '/7000/;NR==2'
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:7000 0.0.0.0:* LISTEN
Finally check connectivity from your other node like so:
$ nc -v -w2 10.1.2.3 7000
Connection to 10.1.2.3 7000 port [tcp/afs3-bos] succeeded!
The -v
is for verbose and the -w
is a timeout
Note outside of testing ports, ping is not going to be a good test for general connectivity because in a lot of cases ICMP packets are dropped (security). So if it doesn't ping, it doesn't mean you have a connection issue.
Upvotes: 3