Storm1.0集群部署(HA)

storm1.0.2下载地址
http://archive.apache.org/dist/storm/apache-storm-1.0.2/apache-storm-1.0.2.tar.gz

storm ha集群规划

Nimbus    :192.168.175.141(active), 192.168.175.142
Supervisor:192.168.175.141, 192.168.175.142, 192.168.175.143

 

storm部署步骤

1 解压/重命名

tar -zxf /home/apps/apache-storm-1.0.2.tar.gz
mv apache-storm-1.0.2 storm

2 配置环境变量

#storm_env
export STORM_HOME=/home/apps/storm
export PATH=$PATH:$STORM_HOME/bin

3 hosts配置

一定要在/etc/hosts文件中配置ip地址与主机名的映射关系
如:192.168.175.141 mini01

4 配置storm.yaml

进入storm/conf目录,修改storm.yaml配置文件为如下内容

# zookeeper ip
 storm.zookeeper.servers:
     - "mini05"
     - "mini06"
     - "mini07"
 storm.zookeeper.port: 2181
 storm.zookeeper.root: "/storm"

#Nimbus H/A
 nimbus.seeds: ["mini01", "mini02"]

#Nimbus dir
 storm.local.dir: "/home/apps/storm/tmp"

#supervisor worker port, 4 workers example
 supervisor.slots.ports:
    - 6700
    - 6701
    - 6702
    - 6703

绝大多数配置信息都是使用默认值,具体参考:
https://github.com/apache/storm/blob/v1.0.2/conf/defaults.yaml

5 拷贝到其他节点

scp -r /home/apps/storm @mini02:/home/apps/
scp -r /home/apps/storm @mini03:/home/apps/

6 启动

按nimbus、supervisor的分布情况启动storm进程

mini01上启动nimbus、supervisor、ui
nohup storm nimbus >/dev/null 2>&1 &
nohup storm supervisor >/dev/null 2>&1 &
nohup storm ui >/dev/null 2>&1 &

mini02启动nimbus、supervisor、ui
nohup storm nimbus >/dev/null 2>&1 &
nohup storm supervisor >/dev/null 2>&1 &
nohup storm ui >/dev/null 2>&1 &


mini03启动supervisor
nohup storm supervisor >/dev/null 2>&1 &

7 验证

http://mini01:8080/

 

Leave A Comment