我已经安装了 7 个 Ubuntu 14.04 LTS 服务器的 VM 实例。第一个实例运行 namenode 服务,所有其他 6 个节点运行 datanode 服务。我认为我的 NameNode 由于某些问题而崩溃或阻塞。 重新启动后,如果我检查 JPS 命令输出,我的名称节点正在运行。在 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 输出,名称节点消失了。
这是重启后一分钟的 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
正如我所说,namenode 不存在。我重复了上述过程几次,每次我得到相同的结果,端口 8020 不存在并且 namenode 崩溃。我认为这是防火墙问题,您认为如何?
提前致谢。
最佳答案
看起来你的名称节点确实崩溃了。尝试停止所有 hadoop 守护进程,然后删除所有数据节点数据并格式化您的名称节点。
用于停止hadoop守护进程的使用
stop-all.sh
现在使用 rm -r 命令手动删除终端数据节点中的所有数据
要格式化您的名称节点,请使用此
hadoop namenode -format
然后使用此命令再次启动所有守护进程
start-all.sh
希望有帮助。
关于linux - namenode端口被阻塞,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29193326/