启动hadoop集群的一个脚本start-hadoop-all.sh

#!/bin/bash

#启动ZK
for sxt in node002 node003 node004
do
	ssh $sxt "source ~/.bash_profile; zkServer.sh start"
done
sleep 2

#启动hdfs
start-dfs.sh
sleep 2

#启动yarn
	ssh node001 "source ~/.bash_profile; start-yarn.sh"
	ssh node004 "source ~/.bash_profile; yarn-daemon.sh start resourcemanager"

echo "=================node001-jps================="
jps

for sxt in node002 node003 node004
do
	echo "=================$node-jps================="
	ssh $node "source ~/.bash_profile; jps"
done

你可能感兴趣的:(大数据)