此页面上的内容需要较新版本的 Adobe Flash Player。

获取 Adobe Flash Player

您现在的位置: 智可网 - 新技术 - Hadoop - 正文
Hadoop2.2.0集群启动和停止Shell脚本
教程录入:李隆权    责任编辑:quan 作者:佚名 文章来源:linuxidc

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"

分享
打赏我
打开支付宝"扫一扫" 打开微信"扫一扫"
客户端
"扫一扫"下载智可网App
意见反馈
Hadoop2.2.0集群启动和停止Shell脚本
作者:佚名 来源:linuxidc

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"