1. hadoop-cluster.sh
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: sh hadoop-cluster.sh [start|stop]"
exit 2
fi
source /etc/profile
${HADOOP_HOME}/sbin/$1-all.sh && ${HADOOP_HOME}/sbin/mr-jobhistory-daemon.sh $1 historyserver
2. zookeeper-cluster.sh
#!/bin/bash
if [ $# -ne 1 ];then
echo "Usage: sh zookeeper-cluster.sh [start|stop|restart]"
exit 2
fi
for node in master.bigdata.com slave01.bigdata.com slave02.bigdata.com
do
echo $node
ssh $node "source /etc/profile && /opt/cdh5.3.6/zookeeper-3.4.5/bin/zkServer.sh $1"
done
3. spark-cluster.sh
#!/bin/bash
if [ $# -ne 1 ];then