一键启动hadoop集群、zookeeper集群、spark集群shell脚本
2018-03-14 00:33
711 查看
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
echo "Usage: sh spark-cluster.sh [start|stop]"
exit 2
fi
ssh master.bigdata.com
"source /etc/profile && ${SPARK_HOME}/sbin/$1-all.sh && && ${SPARK_HOME}/sbin/$1-history-server.sh"
ssh slave01.bigdata.com
"source /etc/profile && ${SPARK_HOME}/sbin/$1-master.sh"
ssh slave02.bigdata.com
"source /etc/profile && ${SPARK_HOME}/sbin/$1-master.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
echo "Usage: sh spark-cluster.sh [start|stop]"
exit 2
fi
ssh master.bigdata.com
"source /etc/profile && ${SPARK_HOME}/sbin/$1-all.sh && && ${SPARK_HOME}/sbin/$1-history-server.sh"
ssh slave01.bigdata.com
"source /etc/profile && ${SPARK_HOME}/sbin/$1-master.sh"
ssh slave02.bigdata.com
"source /etc/profile && ${SPARK_HOME}/sbin/$1-master.sh"
相关文章推荐
- Shell脚本一键启动/关闭 zookeeper集群(版本1.0)
- Shell脚本一键启动/关闭 zookeeper集群(版本1.1)
- hadoop、spark、zookeeper、hive集群搭建脚本
- hadoop-yarn集群中,通过shell脚本自动化提交spark任务
- Hadoop概念学习系列之Java调用Shell命令和脚本,致力于hadoop/spark集群(三十六)
- 使用 Shell 脚本进行 Hadoop Spark 集群的批量安装
- hadoop、zookeeper、hbase、spark集群环境搭建
- Ubuntu16.04 下 Spark2.0.2+Hadoop2.7.3+Zookeeper3.4.9+HBase1.1.7集群环境搭建--5
- shell 脚本实战笔记(10)--spark集群脚本片段念念碎
- zookeeper集群shell脚本启动
- shell脚本在容器云中搭建hadoop集群(五)
- shell脚本在容器云中搭建hadoop集群(六)
- Ubuntu16.04 下 Spark2.0.2+Hadoop2.7.3+Zookeeper3.4.9+HBase1.1.7集群环境搭建--4
- 【Zanuck 镇】GlusterFS集群一键启动脚本(Centos:shell)
- shell脚本在容器云中搭建hadoop集群(四)
- 集群RedHat6.5+JDK1.8+Hadoop2.7.3+Spark2.1.1+zookeeper3.4.6+kafka2.11+flume1.6环境搭建步骤
- shell脚本完成hadoop的集群安装
- Ubuntu16.04 下 Spark2.0.2+Hadoop2.7.3+Zookeeper3.4.9+HBase1.1.7集群环境搭建--3
- [置顶] hadoop、zookeeper、hbase、spark集群环境搭建
- Ubuntu16.04 下 Spark2.0.2+Hadoop2.7.3+Zookeeper3.4.9+HBase1.1.7集群环境搭建--2