hadoop一键关闭脚本

hadoop一键关闭脚本,第1张

hadoop一键关闭脚本 hadoop一键关闭脚本
#!/bin/bash
jps>tmp.txt
NN=`cat tmp.txt|grep -w NameNode`
DN=`cat tmp.txt|grep -w DataNode`
SNN=`cat tmp.txt|grep -w SecondaryNameNode`
RM=`cat tmp.txt|grep -w ResourceManager`
NM=`cat tmp.txt|grep -w NodeManager`
JHS=`cat tmp.txt|grep -w JobHistoryServer`
if [ ${NN} || ${DN} || ${SNN} ];then
stop-dfs.sh
fi
if [ ${NM} || ${RM} ];then
stop-yarn.sh
fi
if [ ${JHS} ];then
mapred --daemon stop historyserver
fi
unset JHS
unset NM
unset RM
unset SNN
unset DN
unset NN
rm -f tmp.txt

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5699604.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存