Hi guys I have some networking issues with Hadoop cluster, and I think I need to know a few basic tips and tricks to speed me along the way to finding out why my app won’t work.
Here are the 4 basic networking questions I have:
1) How can I use netstat to find out which ports are open ?
2) What does it mean for a port to be “open” vs. “closed” ?
3) How can I know which ports, which are open, are attached to which applications, by name?
4) How can I find out which java applications are attached to which ports ?
Context : I have a VM, in hadoop – and it appears that my java program trying to write / read from hdfs cant see the, or can’t access the hdfs via hftp (related question is here How can I access hadoop via the hdfs protocol from java? ).
List all ports that are listening (you can connect to them using telnet):
netstat -nap | grep LISTENHere open probably means some process is listening for connections in that port.
netstat -nap | grep LISTENlists process id in one column.All java processes however only show java as the host process (they don’t show which Java app they are running). If you want to see which Java app process is running you can do
ps -aux | grep XXXwhere XXX is the process id.