无法连接到Hadoop端口 9000

分享于 

2分钟阅读

ubuntu

  繁體

问题

telnet localhost或telnet localhost 9000得到了这样的结果:


Trying 127.0.0.1... 


telnet: Unable to connect to remote host: Connection refused



nmap结果:


$ nmap localhost



Starting Nmap 6.00 ( http://nmap.org ) at 2013-10-03 00:54 MSK


Nmap scan report for localhost (127.0.0.1)


Host is up (0.00030s latency).


rDNS record for 127.0.0.1: localhost.localdomain


Not shown: 992 closed ports


PORT STATE SERVICE


22/tcp open ssh


25/tcp open smtp


80/tcp open http


587/tcp open submission


631/tcp open ipp


3306/tcp open mysql


5432/tcp open postgresql


6566/tcp open sane-port



9000端口上的nmap:


$ nmap -p 9000 localhost



Starting Nmap 6.00 ( http://nmap.org ) at 2013-10-03 00:55 MSK


Nmap scan report for localhost (127.0.0.1)


Host is up (0.000040s latency).


rDNS record for 127.0.0.1: localhost.localdomain


PORT STATE SERVICE


9000/tcp closed cslistener




答案1

connection refused的原因很简单,端口9000未使用。

使用命令> lsof -i :9000查看使用端口的应用程序,如果结果为空(返回值1),意味着端口未打开。

甚至可以用netcat进一步测试。

终端会话9000中的端口1列表


nc -l -p 9000



在另一个会话中,连接到它


$ lsof -i :9000


COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME


nc 12679 terry 3u IPv4 7518676 0t0 TCP *:9000 (LISTEN)


$ nc -vz localhost 9000


Connection to localhost 9000 port [tcp/*] succeeded!




CAN  Hadoop  
相关文章