linux集群启动脚本,Hadoop2.2.0集群启动和停止Shell脚本

说明:Hadoop2.2.0集群启动和停止Shell脚本,以下脚本中出现的master,slave1,slave2,slave3均已配host。

startupall.sh

#!/bin/bash

hadoophome="/home/yarn/Hadoop/hadoop-2.2.0/"

ssh slave1 "/bin/bash ${hadoophome}sbin/hadoop-daemon.sh start journalnode"

ssh slave2 "/bin/bash ${hadoophome}sbin/hadoop-daemon.sh start journalnode"

ssh slave3 "/bin/bash ${hadoophome}sbin/hadoop-daemon.sh start journalnode"

ssh master "/bin/bash ${hadoophome}sbin/hadoop-daemon.sh start namenode"

echo "now waiting for 8s security mode "

sleep 8s

ssh slave1 "/bin/bash ${hadoophome}bin/hdfs namenode -bootstrapStandby"

ssh slave1 "/bin/bash ${hadoophome}sbin/hadoop-daemon.sh start namenode"

ssh master "/bin/bash ${hadoophome}bin/hdfs haadmin -transitionToActive nn1"

ssh master "/bin/bash ${hadoophome}sbin/hadoop-daemons.sh start datanode"

ssh master "/bin/bash ${hadoophome}sbin/start-yarn.sh"

ssh slave1 "/bin/bash ${hadoophome}sbin/mr-jobhistory-daemon.sh start historyserver"

shutdownall.sh

#!/bin/bash

hadoophome="/home/yarn/Hadoop/hadoop-2.2.0/"

ssh master "/bin/bash ${hadoophome}sbin/stop-yarn.sh"

ssh master "/bin/bash ${hadoophome}sbin/stop-dfs.sh"

ssh slave1 "/bin/bash ${hadoophome}sbin/mr-jobhistory-daemon.sh stop historyserver"

0b1331709591d260c1c78e86d0c51c18.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值