共计 1614 个字符,预计需要花费 5 分钟才能阅读完成。
说明: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”
Ubuntu 13.04 上搭建 Hadoop 环境 http://www.linuxidc.com/Linux/2013-06/86106.htm
Ubuntu 12.10 +Hadoop 1.2.1 版本集群配置 http://www.linuxidc.com/Linux/2013-09/90600.htm
Ubuntu 上搭建 Hadoop 环境(单机模式 + 伪分布模式)http://www.linuxidc.com/Linux/2013-01/77681.htm
Ubuntu 下 Hadoop 环境的配置 http://www.linuxidc.com/Linux/2012-11/74539.htm
单机版搭建 Hadoop 环境图文教程详解 http://www.linuxidc.com/Linux/2012-02/53927.htm
搭建 Hadoop 环境(在 Winodws 环境下用虚拟机虚拟两个 Ubuntu 系统进行搭建)http://www.linuxidc.com/Linux/2011-12/48894.htm
更多 Hadoop 相关信息见 Hadoop 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=13