1一键脚本
#!/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

x
 
1
#!/bin/bash
2

3
# 1 声明
4
#--------------------------------------
5
#请在strom/bin/下执行脚本
6
#supervisor-hosts:配置supervisor的主机名,请自行配置
7
#BASH_PATH 需要自行配置
8
#--------------------------------------
9
BASH_PATH=/root/apps/storm-1.1.1
10
cd $BASH_PATH/bin
11
# 2 创建启动脚本文件
12
touch start-supervisor.sh
13
touch start-storm.sh
14
touch stop-supervisor.sh
15
touch stop-storm.sh
16
touch supervisor-hosts
17

18
# 3 赋予执行权限
19
chmod +x *.sh
20

21
# 4 start-supervisor.sh
22
cat>start-supervisor.sh<<EOF
23
#!/bin/bash
24
$BASH_PATH/bin/storm supervisor >/dev/null 2>&1 &
25
EOF
26

27
# 5 start-storm.sh
28
cat>start-storm.sh<<EOF
29
#!/bin/bash
30
$BASH_PATH/bin/storm nimbus >/dev/null 2>&1 &
31
$BASH_PATH/bin/storm ui >/dev/null 2>&1 &
32
cat $BASH_PATH/bin/supervisor-hosts | while read supervisor
33
do
34
    echo "\$supervisor is start..."
35
    ssh \$supervisor $BASH_PATH/bin/start-supervisor.sh &
36
done
37
EOF
38

39
# 6 stop-supervisor.sh
40
cat>stop-supervisor.sh<<EOF
41
#!/bin/bash
42
kill -9 `ps -ef|grep daemon.supervisor| awk '{print $2}'`
43
# 选择是否清除工作目录文件
44
#rm -rf /software/storm/workdir/*
45
EOF
46

47
# 7 stop-storm.sh
48
cat>stop-storm.sh<<EOF
49
#!/bin/bash
50
kill -9 `ps -ef|grep daemon.nimbus| awk '{print $2}'`
51
kill -9 `ps -ef|grep ui.core| awk '{print $2}'`
52
cat $BASH_PATH/bin/supervisor-hosts | while read supervisor
53
do
54
    echo "\$supervisor is stop ..."
55
    ssh \$supervisor $BASH_PATH/bin/stop-supervisor.sh &
56
done
57
EOF
58

59
# 8 supervisor-hosts
60
cat>supervisor-hosts<<EOF
61
mini1
62
mini2
63
mini3
64
EOF
2使用
# 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

17
 
1
# 1 将上文编辑好的start-supervisor和stop-supervisor脚本复制到所有节点相同路径下
2
scp *-supervisor.sh mini2:$PWD
3
scp *-supervisor.sh mini3:$PWD
4
scp *-supervisor.sh mini4:$PWD
5

6
# 2 配置环境变量 
7
#vim /etc/profile
8
STORM_HOME=/root/apps/storm-1.1.1
9
PATH=$PATH:$STORM_HOME/bin
10
export STORM_PATH PATH
11

12
source /etc/profile
13
# 3 启动集群中所有节点supervisor进程,并在主节点上启动nimbus和ui进程
14
start-storm.sh
15

16
# 4 停止集群中所有节点supervisor进程,并停止nimbus和ui进程
17
stop-storm.sh
3添加开启启动
# 开机自动运行下之前的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

x
 
1
# 开机自动运行下之前的start-all脚本,设置方法如下
2
vi /etc/rc.d/rc.local 
3

4
# 添加执行脚本
5
#!/bin/sh
6
#
7
# This script will be executed *after* all the other init scripts.
8
# You can put your own initialization stuff in here if you don't
9
# want to do the full Sys V style init stuff.
10

11
touch /var/lock/subsys/local
12
sh /root/apps/storm-1.1.1/bin/start-storm.sh

storm一键脚本的更多相关文章

  1. Linux FTP 上传一键脚本

    下面来介绍一下这个 FTP 上传一键脚本 ftp_upload.sh. 用途:用于在Linux系统下搭建FTP客户端向FTP服务器端上传文件: 总结一下 ftp_upload.sh 特点:1.支持文件 ...

  2. Linux一键脚本合集vps

    首先,想说说一键脚本流行的原因何在? 众所周知的是,Linux 是占据大半壁江山的服务器系统,但在桌面上的占有率可就远不是那么回事儿了,使用和熟悉 Linux 的人远没有 Windows 多,但又因为 ...

  3. Linux 网站文件和数据库全量备份 一键脚本(支持FTP,Google Drive)

    原文连接: https://teddysun.com/469.html 此文为转载,建议查看秋水大神的原文,排版更容易查看,另外,建议查看脚本源码,方便了解脚本运行过程, 脚本已测试,大神的脚本一如既 ...

  4. 24个节点测试Linux VPS/服务器速度一键脚本使用 附服务器配置

    对于大部分网友而言,我们是希望购买的VPS.服务器既便宜也稳定,甚至还能提供更好的优质服务.这样的商家有没有呢?回答是基本没有.但是,只要我们购买的VPS在稳定性 和速度上对比同类的商家差不多,或者自 ...

  5. Google Drive网盘文件直链获取一键脚本

    说明:本脚本可以将Google Drive网盘的文件分享链接或者文件ID变成直链,方便我们在很多情况下调用.只支持文件分享,不支持文件夹.文件分享ID为26到48位.   使用 1.需求 wget.g ...

  6. 一键脚本清理DEBIAN系统无用组件 减少系统资源

    虽然如今我们选择服务器资源都比较多,以前我们看到很多128MB内存.甚至32MB内存的建站网站,感觉特别羡慕.其实这些也不是难事,相比之下,DEBIAN系统比CENTOS系统占用资源少,然后我们需要进 ...

  7. MySQL源码安装一键脚本

    #红色部分根据自己的需求来定义#!/bin/bash #卸载系统自带的Mysql /bin/rpm -e $(/bin/rpm -qa | grep mysql|xargs) --nodeps /bi ...

  8. Ubuntu安装编译OpenCV一键脚本(带ffmpeg)

    1.切换到用户文件夹 cd ~ 2.新建一个文件.命名为opencv.sh 脚本例如以下: version="$(wget -q -O - http://sourceforge.net/pr ...

  9. 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. ...

随机推荐

  1. 【转】cve-2013-2094 perf_event_open 漏洞分析

    cve-2013-2094是于2013年4月前后发现的linux kernel本地漏洞,该漏洞影响3.8.9之前开启了PERF_EVENT的linux系统.利用该漏洞,通过perf_event_ope ...

  2. Linux时间子系统之八:动态时钟框架(CONFIG_NO_HZ、tickless)【转】

    转自:http://blog.csdn.net/droidphone/article/details/8112948 版权声明:本文为博主原创文章,未经博主允许不得转载.   目录(?)[-] 数据结 ...

  3. abp 调试

    概要 研究Abp(ASP.NET Boilerplate)框架有几个月了,从一遍遍的看官方文档,到现在看源码,一路走来学习了很多知识. 很多新手都很关心源码如何调试,我也是如此,在反复看Debuggi ...

  4. 【java报错】Unknown character set index for field '224' received from server.

    在捣腾免费数据库时,使用的一个数据库提供商的服务器使用utf8mb4编码,而我的jar包还是八百年前的.然后...然后就报错了... (1) MYSQL 5.5 之前, UTF8 编码只支持1-3个字 ...

  5. sleep() 函数

    函数名: sleep 功 能: 执行挂起一段时间 用 法: unsigned sleep(unsigned seconds); 头文件 #include <windows.h>  # wi ...

  6. Linq to SQL 小结

    前天开始看这方面的资料,虽然看了网上对比 sql和linq的速度,万条数据可能要慢1/4左右的数度,但是介于的方便,还是学了 首先看看linq的基本语法: FROM XX IN DATASOURCE ...

  7. 修改centos地址连接为自动连接

    1.进入目录/etc/sysconfig/network-scripts/ 2.修改ifcfg-etn0 文件   (即你的网卡标识命名的配置文件) 3.将ONBOOT=no改成yes 4.保存后重启 ...

  8. 让IE6支持css3,让 IE7、IE8 都支持CSS3

    但凡是前端工程师,都知道IE6,IE7,IE8不支持.或者不完全支持CSS3的属性. CSS3 有很多很强大.绚丽的效果,比如,圆角,阴影,渐变透明,渐变背景,等等. 因为IE6时代,没有什么标准,而 ...

  9. 《深入浅出MyBatis技术原理与实战》——7. 插件

    在第6章讨论了四大运行对象的运行过程,在Configuration对象的创建方法里我们看到了MyBatis用责任链去封装它们. 7.1 插件接口 在MyBatis中使用插件,我们必须使用接口Inter ...

  10. 五:ZooKeeper的集群命令客户端的链接和命令操作的使用

    一:zookeeper客户端链接[1]进入zookeeper的安装目录的bin目录下         # cd /opt/zookeeper/bin[2]敲击链接客户端的命令(zkCli.sh)    ...