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. ...
随机推荐
- java基础 流程控制和条件语句,循环语句
顺序结构 程序的顺序结构: 如果代码里没有流程控制,程序是按照书写的格式从上而下一行一行执行的, 一条语句执行完之后继续执行下一条语句,中间没有判断和跳转,直到程序的结束. if语句 if语句使用bo ...
- linux===linux后台运行和关闭、查看后台任务(转)
fg.bg.jobs.&.ctrl + z都是跟系统任务有关的,虽然现在基本上不怎么需要用到这些命令,但学会了也是很实用的 一.& 最经常被用到这个用在一个命令的最后,可以把这个命令放 ...
- 看jquery3.3.1学js类型判断的技巧
需要预习:call , typeof, js数据类型 1. isFunction中typeof的不靠谱 源码: var isFunction = function isFunction( obj ) ...
- interrupted()和isInterrupted()比较+终止线程的正确方法+暂停线程
interrupted():测试当前线程[运行此方法的当前线程]是否已经是中断状态,执行后具有将状态标志清除为false的功能. isInterrupted():测试线程对象是否已经是中断状态,但不清 ...
- HDU 5116 Everlasting L
题目链接:HDU-5116 题意:给定若干个整数点,若一个点集满足P = {(x, y), (x + 1, y), . . . , (x + a, y), (x, y + 1), . . . , (x ...
- idea和maven使用的点点滴滴
1.如果在使用maven打包时想跳过单元测试,可以在pom文件中配置如下代码 <build> <plugins> <plugin> <groupId>o ...
- [ python ] hasattr()、getattr()、setattr() 三者关系及运用
hasattr(object, name) 判断一个对象(object)是否存在name属性或方法,返回boolean值,有name属性返回True, 否则返回False In [1]: class ...
- 手机端GPS定位结合百度地图实现定位
html页面: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Typ ...
- P2511 [HAOI2008]木棍分割
目录 Description Solution Code Description 有n根木棍, 第i根木棍的长度为Li,n根木棍依次连结了一起, 总共有n-1个连接处. 现在允许你最多砍断m个连接处, ...
- 【python】r+,w+ 全局变量
来源:http://www.educity.cn/wenda/352188.html r+:可读可写,若文件不存在,报错w+: 可读可写,若文件不存在,创建文本模式:遇换行符时根据操作系统不同自动转换 ...