hdfs datanode
stop-dfs.sh report that there are no datanodes running on some nodes like
stop-dfs.sh报告在某些节点(例如,
hdfs-node-000208: no datanode to stop
However, there are DataNode process running there. How to clean these processes on many (100s) of nodes?
但是,那里正在运行DataNode进程。 如何清除许多(100)节点上的这些进程?
You may use this piece of bash script:
您可以使用以下bash脚本:
for i in `cathadoop/etc/hadoop/slaves`; do
echo $i;
ssh $i
'jps | grep DataNode | cut -d" " -f1
| xargs --no-run-if-empty -I@ bash -c "echo -- killing @; kill @"';
done
What it does is, for each slave ndoes, run the command started by jps
:
它的作用是,对于每个从属ndoes,运行由jps
启动的命令:
finds DataNode Java processes, gets the process IDs and passes these IDs to kill
to kill them.
发现的DataNode Java进程,获取进程ID,然后将这些ID来kill
,杀死他们。
翻译自: https://www.systutorials.com/how-to-manually-kill-hdfs-datanodes/
hdfs datanode