名称节点端口被阻塞

namenode port is getting blocked

我已经安装了 Ubuntu 14.04 LTS 服务器的 7 个 VM 实例。第一个实例 运行s namenode 服务和所有其他 6 个节点 运行 datanode service.I 认为我的 NameNode 由于某些问题而崩溃或被阻止。 重新启动后,如果我检查 JPS 命令输出,我的名称节点是 运行ning。在 core-site.xml 中,fs.defaultfs 属性 设置为 hdfs://instance-1:8020。 但在 netstat -tulpn 输出中不存在 8020 端口。

这是重启后的 JPS 输出。

root@instance-1:~# jps
3017 VersionInfo
2613 NameNode
3371 VersionInfo
3313 ResourceManager
3015 Main
2524 QuorumPeerMain
2877 HeadlampServer
1556 Main
3480 Jps
2517 SecondaryNameNode
3171 JobHistoryServer
2790 EventCatcherService
2842 AlertPublisher
2600 Bootstrap
2909 Main

这是我在 jps 之后检查的 netstat 输出。

root@instance-1:~# netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      600/rpcbind     
tcp        0      0 0.0.0.0:9010            0.0.0.0:*               LISTEN      2524/java       
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1164/sshd       
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      1158/postgres   
tcp        0      0 127.0.0.1:19001         0.0.0.0:*               LISTEN      1496/python     
tcp        0      0 0.0.0.0:42043           0.0.0.0:*               LISTEN      2524/java       
tcp        0      0 10.240.71.132:9000      0.0.0.0:*               LISTEN      1419/python     
tcp        0      0 0.0.0.0:7432            0.0.0.0:*               LISTEN      1405/postgres   
tcp6       0      0 :::111                  :::*                    LISTEN      600/rpcbind     
tcp6       0      0 :::22                   :::*                    LISTEN      1164/sshd       
tcp6       0      0 :::7432                 :::*                    LISTEN      1405/postgres   
udp        0      0 0.0.0.0:68              0.0.0.0:*                           684/dhclient    
udp        0      0 0.0.0.0:111             0.0.0.0:*                           600/rpcbind     
udp        0      0 10.240.71.132:123       0.0.0.0:*                           3323/ntpd       
udp        0      0 127.0.0.1:123           0.0.0.0:*                           3323/ntpd       
udp        0      0 0.0.0.0:123             0.0.0.0:*                           3323/ntpd       
udp        0      0 0.0.0.0:721             0.0.0.0:*                           600/rpcbind     
udp        0      0 0.0.0.0:29611           0.0.0.0:*                           684/dhclient    
udp6       0      0 :::111                  :::*                                600/rpcbind     
udp6       0      0 :::123                  :::*                                3323/ntpd       
udp6       0      0 :::721                  :::*                                600/rpcbind     
udp6       0      0 :::22577                :::*                                684/dhclient  

正如我所说,我没有看到 8020 端口。一分钟后,我检查了 JPS 输出,namenode 不见了。

这是重启一分钟后的 jps 输出。

root@instance-1:~# jps
3794 Main
3313 ResourceManager
3907 EventCatcherService
4325 Jps
2530 RunJar
3082 RunJar
2524 QuorumPeerMain
2656 Bootstrap
2877 HeadlampServer
1556 Main
2517 SecondaryNameNode
3171 JobHistoryServer
2842 AlertPublisher
2600 Bootstrap

正如我所说,名称节点不存在。我重复了上面的过程几次,每次我得到相同的结果端口 8020 不存在并且 namenode 崩溃了。我认为是防火墙问题,你怎么看?

提前致谢。

我没有完整的答案,但我知道您可以转到 namenode 所在机器中的 Hadoop 文件夹 运行,然后转到 logs 文件夹,然后打开包含以下内容的文件namenode 的日志,它的名字应该像 hadoop-username-namenode-machineName.log 其中 username 是您计算机的用户名,machine name 是这台机器的主机名。

一直走到该文件的末尾,您可能会看到导致问题的确切错误

祝你好运

看起来你的名称节点确实崩溃了。尝试停止所有 hadoop 守护进程,然后删除所有数据节点数据并格式化您的名称节点。

停止 hadoop 守护进程使用

stop-all.sh

现在使用rm -r 命令

为终端手动删除数据节点中的所有数据

要格式化您的名称节点,请使用此

hadoop namenode -format 

然后使用这个

再次启动所有守护进程
start-all.sh

希望对您有所帮助。