The mahout algorithm has been studied recently, and the Hadoop cluster has not changed much; today suddenly wanted to stop the Hadoop cluster, but found that it couldn't stop. The./bin/stop-all.sh command always prompts for no stop job, task, Namenode, Datanode, Secondarynode. But the input JPS command, found that Hadoop has been started, and HDFs connection is normal. Later, under the guidance of colleagues, understand; Originally, after Hadoop started, process information was saved by default in the/tmp folder. The information is as follows:
-rw-rw-r--1 Hadoop Hadoop 5 Aug 5 11:04 hadoop-hadoop-datanode.pid
-rw-rw-r--1 Hadoop Hadoop 5 Aug 5 11:04 hadoop-hadoop-jobtracker.pid
-rw-rw-r--1 Hadoop Hadoop 5 Aug 5 11:04 hadoop-hadoop-namenode.pid
-rw-rw-r--1 Hadoop Hadoop 5 Aug 5 11:04 hadoop-hadoop-secondarynamenode.pid
-rw-rw-r--1 Hadoop Hadoop 5 Aug 5 11:04 hadoop-hadoop-tasktracker.pid
The/tmp folder will be emptied periodically, so after a while, the process information for Hadoop will be removed, so that the next time you stop the cluster, it will stop.
Workaround:
1. Refer to the Stop-all.sh script file code to manually stop all related processes.
Stop order: Job, Task, Namenode, Datanode, Secondarynode
2. Restart the cluster and view the/tmp folder again, and you will see the above process information. This is the time to execute the stop-all.sh command to gracefully shut down the Hadoop cluster.
3. If you don't want to be so troublesome every time, you can modify the scripting code.