注意配置 ~ 目录下的(.bashrc)文件,在其中配置JAVA_HOME,并source ~/.bashrc

Hadoop群启脚本和关闭(YARN、HDFS、Zookeeper、JobHistoryServer)_Hadoop群启脚本和关闭

全部机器都配置哦

群启:

#!/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'