storm一键脚本
# 1 声明
#--------------------------------------
#请在strom/bin/下执行脚本
#supervisor-hosts:配置supervisor的主机名,请自行配置
#BASH_PATH 需要自行配置
#--------------------------------------
BASH_PATH=/root/apps/storm-1.1.1
cd $BASH_PATH/bin
# 2 创建启动脚本文件
touch start-supervisor.sh
touch start-storm.sh
touch stop-supervisor.sh
touch stop-storm.sh
touch supervisor-hosts
# 3 赋予执行权限
chmod +x *.sh
# 4 start-supervisor.sh
cat>start-supervisor.sh<<EOF
#!/bin/bash
$BASH_PATH/bin/storm supervisor >/dev/null 2>&1 &
EOF
# 5 start-storm.sh
cat>start-storm.sh<<EOF
#!/bin/bash
$BASH_PATH/bin/storm nimbus >/dev/null 2>&1 &
$BASH_PATH/bin/storm ui >/dev/null 2>&1 &
cat $BASH_PATH/bin/supervisor-hosts | while read supervisor
do
echo "\$supervisor is start..."
ssh \$supervisor $BASH_PATH/bin/start-supervisor.sh &
done
EOF
# 6 stop-supervisor.sh
cat>stop-supervisor.sh<<EOF
#!/bin/bash
kill -9 `ps -ef|grep daemon.supervisor| awk '{print $2}'`
# 选择是否清除工作目录文件
#rm -rf /software/storm/workdir/*
EOF
# 7 stop-storm.sh
cat>stop-storm.sh<<EOF
#!/bin/bash
kill -9 `ps -ef|grep daemon.nimbus| awk '{print $2}'`
kill -9 `ps -ef|grep ui.core| awk '{print $2}'`
cat $BASH_PATH/bin/supervisor-hosts | while read supervisor
do
echo "\$supervisor is stop ..."
ssh \$supervisor $BASH_PATH/bin/stop-supervisor.sh &
done
EOF
# 8 supervisor-hosts
cat>supervisor-hosts<<EOF
mini1
mini2
mini3
EOF
x
#!/bin/bash
# 1 声明
#--------------------------------------
#请在strom/bin/下执行脚本
#supervisor-hosts:配置supervisor的主机名,请自行配置
#BASH_PATH 需要自行配置
#--------------------------------------
BASH_PATH=/root/apps/storm-1.1.1
cd $BASH_PATH/bin
# 2 创建启动脚本文件
touch start-supervisor.sh
touch start-storm.sh
touch stop-supervisor.sh
touch stop-storm.sh
touch supervisor-hosts
# 3 赋予执行权限
chmod +x *.sh
# 4 start-supervisor.sh
cat>start-supervisor.sh<<EOF
#!/bin/bash
$BASH_PATH/bin/storm supervisor >/dev/null 2>&1 &
EOF
# 5 start-storm.sh
cat>start-storm.sh<<EOF
#!/bin/bash
$BASH_PATH/bin/storm nimbus >/dev/null 2>&1 &
$BASH_PATH/bin/storm ui >/dev/null 2>&1 &
cat $BASH_PATH/bin/supervisor-hosts | while read supervisor
do
echo "\$supervisor is start..."
ssh \$supervisor $BASH_PATH/bin/start-supervisor.sh &
done
EOF
# 6 stop-supervisor.sh
cat>stop-supervisor.sh<<EOF
#!/bin/bash
kill -9 `ps -ef|grep daemon.supervisor| awk '{print $2}'`
# 选择是否清除工作目录文件
#rm -rf /software/storm/workdir/*
EOF
# 7 stop-storm.sh
cat>stop-storm.sh<<EOF
#!/bin/bash
kill -9 `ps -ef|grep daemon.nimbus| awk '{print $2}'`
kill -9 `ps -ef|grep ui.core| awk '{print $2}'`
cat $BASH_PATH/bin/supervisor-hosts | while read supervisor
do
echo "\$supervisor is stop ..."
ssh \$supervisor $BASH_PATH/bin/stop-supervisor.sh &
done
EOF
# 8 supervisor-hosts
cat>supervisor-hosts<<EOF
mini1
mini2
mini3
EOF
scp *-supervisor.sh mini2:$PWD
scp *-supervisor.sh mini3:$PWD
scp *-supervisor.sh mini4:$PWD
# 2 配置环境变量
#vim /etc/profile
STORM_HOME=/root/apps/storm-1.1.1
PATH=$PATH:$STORM_HOME/bin
export STORM_PATH PATH
source /etc/profile
# 3 启动集群中所有节点supervisor进程,并在主节点上启动nimbus和ui进程
start-storm.sh
# 4 停止集群中所有节点supervisor进程,并停止nimbus和ui进程
stop-storm.sh
# 1 将上文编辑好的start-supervisor和stop-supervisor脚本复制到所有节点相同路径下
scp *-supervisor.sh mini2:$PWD
scp *-supervisor.sh mini3:$PWD
scp *-supervisor.sh mini4:$PWD
# 2 配置环境变量
#vim /etc/profile
STORM_HOME=/root/apps/storm-1.1.1
PATH=$PATH:$STORM_HOME/bin
export STORM_PATH PATH
source /etc/profile
# 3 启动集群中所有节点supervisor进程,并在主节点上启动nimbus和ui进程
start-storm.sh
# 4 停止集群中所有节点supervisor进程,并停止nimbus和ui进程
stop-storm.sh
vi /etc/rc.d/rc.local
# 添加执行脚本
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
sh /root/apps/storm-1.1.1/bin/start-storm.sh
# 开机自动运行下之前的start-all脚本,设置方法如下
vi /etc/rc.d/rc.local
# 添加执行脚本
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
sh /root/apps/storm-1.1.1/bin/start-storm.sh
storm一键脚本的更多相关文章
- Linux FTP 上传一键脚本
下面来介绍一下这个 FTP 上传一键脚本 ftp_upload.sh. 用途:用于在Linux系统下搭建FTP客户端向FTP服务器端上传文件: 总结一下 ftp_upload.sh 特点:1.支持文件 ...
- Linux一键脚本合集vps
首先,想说说一键脚本流行的原因何在? 众所周知的是,Linux 是占据大半壁江山的服务器系统,但在桌面上的占有率可就远不是那么回事儿了,使用和熟悉 Linux 的人远没有 Windows 多,但又因为 ...
- Linux 网站文件和数据库全量备份 一键脚本(支持FTP,Google Drive)
原文连接: https://teddysun.com/469.html 此文为转载,建议查看秋水大神的原文,排版更容易查看,另外,建议查看脚本源码,方便了解脚本运行过程, 脚本已测试,大神的脚本一如既 ...
- 24个节点测试Linux VPS/服务器速度一键脚本使用 附服务器配置
对于大部分网友而言,我们是希望购买的VPS.服务器既便宜也稳定,甚至还能提供更好的优质服务.这样的商家有没有呢?回答是基本没有.但是,只要我们购买的VPS在稳定性 和速度上对比同类的商家差不多,或者自 ...
- Google Drive网盘文件直链获取一键脚本
说明:本脚本可以将Google Drive网盘的文件分享链接或者文件ID变成直链,方便我们在很多情况下调用.只支持文件分享,不支持文件夹.文件分享ID为26到48位. 使用 1.需求 wget.g ...
- 一键脚本清理DEBIAN系统无用组件 减少系统资源
虽然如今我们选择服务器资源都比较多,以前我们看到很多128MB内存.甚至32MB内存的建站网站,感觉特别羡慕.其实这些也不是难事,相比之下,DEBIAN系统比CENTOS系统占用资源少,然后我们需要进 ...
- MySQL源码安装一键脚本
#红色部分根据自己的需求来定义#!/bin/bash #卸载系统自带的Mysql /bin/rpm -e $(/bin/rpm -qa | grep mysql|xargs) --nodeps /bi ...
- Ubuntu安装编译OpenCV一键脚本(带ffmpeg)
1.切换到用户文件夹 cd ~ 2.新建一个文件.命名为opencv.sh 脚本例如以下: version="$(wget -q -O - http://sourceforge.net/pr ...
- zabbix官方源替换为阿里云的zabbix源,一键脚本。(安装zabbix报错curl#18 - "transfer closed with 2988713 bytes remaining to read":15 ETA Trying other mirro)
最近突然安装zabbix总是报错,比如 (24/27): t1lib-5.1.2-14.el7.x86_64.rpm | 166 kB 00:00:00 zabbix-web-4.4.6-1.el7. ...
随机推荐
- linux 设备树【转】
转自:http://blog.csdn.net/chenqianleo/article/details/77779439 [-] linux 设备树 为什么要使用设备树Device Tree 设备树的 ...
- EasyHook远程进程注入并hook api的实现
EasyHook远程进程注入并hook api的实现 http://blog.csdn.net/v6543210/article/details/44276155
- MyEclipse部署项目报"Add Deployment". Invalid Subscription Level - Discontinuing this MyEclipse
"Add Deployment". Invalid Subscription Level - Discontinuing this MyEclipse 猜测应该是MyEclipse ...
- SPOJ Two Paths
Description 给定一个无向图,含有一定的路.从中找出两个最长的路径(每条路径有一些相通路组成)这两个路径不能经过公共的点,求何时二路径的乘积最大. 本题给出的无向图是一棵树,每边权值为1. ...
- [PAT] 1142 Maximal Clique(25 分)
1142 Maximal Clique(25 分) A clique is a subset of vertices of an undirected graph such that every tw ...
- scrapy-redis组件的使用
scrapy-redis是一个基于redis的scrapy组件,通过它可以快速实现简单分布式爬虫程序,该组件本质上提供了三大功能: scheduler - 调度器 dupefilter - URL去重 ...
- Monty Hall悖论
Monty Hall悖论又称为蒙提·霍尔悖论.三门问题.Monty Hall是上个世纪60年代,电视游戏节目“Let's Make a Deal”的主持人,这个悖论便是以他的名字来命名的.节目的规则是 ...
- #1054 - Unknown column 'category' in 'field list'
导致这个问题的原因有: 1.确实没有这个字段 2.写错表了,你以为写到想要的表,没想到写到别处去了,当然没有这个字段了,这时候检查一下sql语句是不是选错了表,或者选错了数据库
- LOJ #6285. 数列分块入门 9-分块(查询区间的最小众数)
#6285. 数列分块入门 9 内存限制:256 MiB时间限制:1500 ms标准输入输出 题目类型:传统评测方式:文本比较 上传者: hzwer 提交提交记录统计测试数据讨论 2 题目描述 给 ...
- 转:Python安全 - 从SSRF到命令执行惨案
转:https://www.leavesongs.com/PENETRATION/getshell-via-ssrf-and-redis.html Python安全 - 从SSRF到命令执行惨案 PH ...