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
start-dfs.sh
else
stop-dfs.sh
start-dfs.sh
fi
if [ ! ${RM} && ! ${NM} ];then
start-yarn.sh
else
stop-yarn.sh
start-yarn.sh
fi
if [ ! ${JHS} ];then
mapred --daemon start historyserver
fi
unset JHS
unset NM
unset RM
unset SNN
unset DN
unset NN
rm -f tmp.txt

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

原文地址:https://54852.com/zaji/5699594.html

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

发表评论

登录后才能评论

评论列表(0条)

    保存