注意配置 ~ 目录下的(.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标签:opt,群启,HDFS,Zookeeper,module,echo,Faded103,ssh,root From: https://blog.51cto.com/u_12654321/5843255
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'