Hadoop群启脚本和关闭(YARN、HDFS、Zookeeper、JobHistoryServer)
原创
©著作权归作者所有:来自51CTO博客作者年轻即出发的原创作品,请联系作者获取转载授权,否则将追究法律责任
注意配置 ~ 目录下的(.bashrc)文件,在其中配置JAVA_HOME,并source ~/.bashrc
全部机器都配置哦
群启:
#!/bin/base
echo "============== 正在启动Zookeeper服务 ==============="
for i in root@Faded103 root@Faded104 root@Faded105
do
ssh $i '/opt/module/zookeeper-3.4.10/bin/zkServer.sh start'
done
echo "============== 正在启动HDFS服务 ==============="
ssh root@Faded103 '/opt/module/hadoop-2.7.2/sbin/start-dfs.sh'
echo "============== 正在启动YARN服务 ==============="
ssh root@Faded104 '/opt/module/hadoop-2.7.2/sbin/start-yarn.sh'
echo "============== root@Faded103正在启动JobHistoryServer服务 ==============="
ssh root@Faded103 '/opt/module/hadoop-2.7.2/sbin/mr-jobhistory-daemon.sh start historyserver'
群关闭:
#!/bin/base
echo "============== 正在关闭Zookeeper服务 ==============="
for i in root@Faded103 root@Faded104 root@Faded105
do
ssh $i '/opt/module/zookeeper-3.4.10/bin/zkServer.sh stop'
done
echo "============== 正在关闭YARN服务 ==============="
ssh root@Faded104 '/opt/module/hadoop-2.7.2/sbin/stop-yarn.sh'
echo "============== 正在关闭HDFS服务 ==============="
ssh root@Faded103 '/opt/module/hadoop-2.7.2/sbin/stop-dfs.sh'
echo "============== root@Faded103正在关闭JobHistoryServer服务 ==============="
ssh root@Faded103 '/opt/module/hadoop-2.7.2/sbin/mr-jobhistory-daemon.sh stop historyserver'