0. Storm源码包下载
http://mirror.bit.edu.cn/apache/storm/
1. 集群环境
Master 172.16.11.97
Slave1 172.16.11.98
Slave2 172.16.11.99
2. 下载安装包
#Master
wget http://mirror.bit.edu.cn/apache/storm/apache-storm-0.9.7/apache-storm-0.9.7.tar.gz
tar zxvf apache-storm-0.9.7.tar.gz
3. 修改Storm配置文件
#Master
cd apache-storm-0.9.7/conf
vim storm.yaml
storm.zookeeper.servers:
- "master"
- "slave1"
- "slave2"
nimbus.host: "master"
supervisor.slots.ports:
- 6700
- 6701
- 6702
- 6703
- 6704
- 6705
4. 配置环境变量
#Master、Slave1、Slave2
vim ~/.bashrc
STORM_HOME=/usr/local/src/apache-storm-0.9.7
export PATH=$PATH:$STORM_HOME/bin
#刷新环境变量
source ~/.bashrc
5. 拷贝安装包
#Master
scp -r /usr/local/src/apache-storm-0.9.7 root@slave1:/usr/local/src/apache-storm-0.9.7
scp -r /usr/local/src/apache-storm-0.9.7 root@slave2:/usr/local/src/apache-storm-0.9.7
6. 启动集群
#master
vim /usr/local/src/apache-storm-0.9.7/bin/start-storm-master.sh
python /usr/local/src/apache-storm-0.9.7/bin/storm nimbus &
python /usr/local/src/apache-storm-0.9.7/bin/storm ui &
python /usr/local/src/apache-storm-0.9.7/bin/storm logviewer &
chmod +x /usr/local/src/apache-storm-0.9.7/bin/start-storm-master.sh
start-storm-master.sh
#Slave1、Slave2
vim /usr/local/src/apache-storm-0.9.7/bin/start-storm-slave.sh
python /usr/local/src/apache-storm-0.9.7/bin/storm supervisor &
python /usr/local/src/apache-storm-0.9.7/bin/storm logviewer &
chmod +x /usr/local/src/apache-storm-0.9.7/bin/start-storm-slave.sh
start-storm-slave.sh
7. 集群状态
jps
#Master
#Slave1
#Slave2
8. 监控页面
9. 关闭集群
#master、Slave1、Slave2
vim /usr/local/src/apache-storm-0.9.7/bin/stop-storm.sh
kill `ps aux| grep storm | grep -v 'grep' | awk '{print $2}'`
chmod +x /usr/local/src/apache-storm-0.9.7/bin/stop-storm.sh
stop-storm.sh