一鍵啟動叢集的shell指令碼,包括HDFS HA + YARN相關所有程式,FBI00X是主機名稱,供大家參考:
#!/bin/bashecho "-------------------------Step1----------------------------" echo "Now,starting Zookeeper."ssh FBI001 $ZOOKEEPER_HOME/bin/zkServer.sh startssh FBI002 $ZOOKEEPER_HOME/bin/zkServer.sh startssh FBI003 $ZOOKEEPER_HOME/bin/zkServer.sh start ssh FBI001 $ZOOKEEPER_HOME/bin/zkServer.sh statusssh FBI002 $ZOOKEEPER_HOME/bin/zkServer.sh statusssh FBI003 $ZOOKEEPER_HOME/bin/zkServer.sh statusecho "Now,Zookeeper is started." echo "-------------------------Step2----------------------------" echo "Now,starting ZKFC."ssh FBI001 $HADOOP_HOME/sbin/hadoop-daemon.sh start zkfcssh FBI002 $HADOOP_HOME/sbin/hadoop-daemon.sh start zkfcecho "Now,ZKFC started." echo "-------------------------Step3----------------------------" echo "Now,starting JN."ssh FBI001 $HADOOP_HOME/sbin/hadoop-daemon.sh start journalnodessh FBI002 $HADOOP_HOME/sbin/hadoop-daemon.sh start journalnodessh FBI003 $HADOOP_HOME/sbin/hadoop-daemon.sh start journalnodeecho "Now,JN started." echo "-------------------------Step4----------------------------" echo "Now,starting Active,Standby NN."ssh FBI001 $HADOOP_HOME/sbin/hadoop-daemon.sh start namenodessh FBI002 $HADOOP_HOME/sbin/hadoop-daemon.sh start namenodeecho "Now,Active,Standby NN started." echo "-------------------------Step5----------------------------" echo "Now,starting DataNodes."ssh FBI001 $HADOOP_HOME/sbin/hadoop-daemons.sh start datanodeecho "Now,DataNodes started." echo "-------------------------Step6----------------------------" echo "Now,starting YARN."ssh FBI003 $HADOOP_HOME/sbin/start-yarn.shecho "Now,YARN started." echo "-------------------------Step7----------------------------" echo "Now,starting MR JobHistory Server."ssh FBI004 $HADOOP_HOME/sbin/mr-jobhistory-daemon.sh start historyserverecho "Now,MR JobHistory Server started."
本欄目更多精彩內容:http://www.bianceng.cnhttp://www.bianceng.cn/webkf/tools/