#! /bin/bash
for i in hadoop01 hadoop02 hadoop03
do echo "********************== $i *************************= "
ssh $i '/opt/software/jdk1.8.0_171/bin/jps'
done
#! /bin/bash
echo "***************= 開始啟動所有節點服務 **********="
echo "***************= 正在啟動zookeeper **********="
for i in hadoop01 hadoop02 hadoop03
do ssh $i '/opt/software/zookeeper-3.4.10/bin/zkserver.sh start'
done
echo "***************= 正在啟動hdfs **********="
ssh hadoop01 '/opt/software/hadoop-2.7.4/sbin/start-dfs.sh'
echo "***************= 正在啟動yarn **********="
ssh hadoop03 '/opt/software/hadoop-2.7.4/sbin/start-yarn.sh'
#echo "***************= 正在開啟jobhistoryserver **********="
#ssh atguigu@hadoop102 '/opt/module/hadoop-2.7.4/sbin/mr-jobhistory-daemon.sh start historyserver'
#! /bin/bash
echo "***************= 開始關閉所有節點服務 **********="
echo "***************= 正在關閉zookeeper **********="
for i in hadoop01 hadoop02 hadoop03
do ssh $i '/opt/software/zookeeper-3.4.10/bin/zkserver.sh stop'
done
echo "***************= 正在關閉hdfs **********="
ssh hadoop01 '/opt/software/hadoop-2.7.4/sbin/stop-dfs.sh'
echo "***************= 正在關閉yarn **********="
ssh hadoop03 '/opt/software/hadoop-2.7.4/sbin/stop-yarn.sh'
#echo "***************= 正在關閉jobhistoryserver **********="
#ssh hadoop102 '/opt/module/hadoop-2.7.4/sbin/mr-jobhistory-daemon.sh stop historyserver'
hadoop 群起指令碼
ssh執行遠端指令碼遇到的坑 ssh連線遠端主機執行指令碼的環境變數問題 ssh 這個方式使用的是bash的non login non interactive模式。是不會讀取 etc profile中的配置,但bash 會判斷標準輸入是否關聯到 sshd 這樣的網路鏈結上,如果是,會讀取 bashr...
zookeeper集群群起指令碼
前提條件 每個節點的zookeeper配置檔案都寫好 在datadir目錄下有myid檔案 最好是已經配置好ssh免密登入。然後就可以啟動了,如果我們機器很多的話,不可能一台一台的啟動。所以要寫個指令碼,我的主機名是有規律的hadoop101 hadoop102 hadoop103 所以建立指令碼的...
群起hadoop集群指令碼(開啟,關閉)
通過執行shell指令碼語句,實現群起hadoop集群 1.start.sh bin bash echo 正在開啟集群服務 echo 正在開啟namenode節點 ssh admin hadoop senior01.itguigu.com opt modules hadoop 2.5.0 cdh5....