stop-all.sh无法停止hadoop集群
执行hadoop的关闭脚本,出现没有可停止的namenode、datanode、secondarynamenode等,如下:
[root@hadoop001 soft]# stop-all.sh This script is Deprecated. Instead use stop-dfs.sh and stop-yarn.sh 19/05/28 18:09:19 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable Stopping namenodes on [hadoop001] hadoop001: no namenode to stop hadoop001: no datanode to stop Stopping secondary namenodes [0.0.0.0] 0.0.0.0: no secondarynamenode to stop 19/05/28 18:09:25 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable stopping yarn daemons no resourcemanager to stop hadoop001: no nodemanager to stop no proxyserver to stop
可是输入 jps 命令,发现hadoop 已经启动了,而且 HDFS连接正常。
[root@hadoop001 sbin]# jps 29248 DataNode 29584 ResourceManager 29155 NameNode 35269 Jps 29382 SecondaryNameNode 29687 NodeManager
后来参考一篇博文,原来 hadoop启动后,进程信息默认保存在 /tmp 文件夹。信息如下:
-rw-r--r-- 1 root root 6 May 28 18:16 hadoop-root-datanode.pid -rw-r--r-- 1 root root 6 May 28 18:16 hadoop-root-namenode.pid -rw-r--r-- 1 root root 6 May 28 18:16 hadoop-root-secondarynamenode.pid -rw-r--r-- 1 root root 6 May 28 18:16 yarn-root-nodemanager.pid -rw-r--r-- 1 root root 6 May 28 18:16 yarn-root-resourcemanager.pid
解决方法:
1. 参考 stop-all.sh 脚本文件代码,手动停止所有相关进程。
停止顺序: job 、task、namenode、datanode、secondarynode
2. 重新启动集群,再次查看 /tmp 文件夹,你会看到以上进程信息。这个时候执行 stop-all.sh 命令能正常关闭 hadoop集群了
参考博文:https://blog.csdn.net/zhoujianfeng3/article/details/38382195