Storm分布式集群搭建
1、解压Storm压缩文件
[[email protected] software]# tar -zxf apache-storm-0.10.0.tar.gz -C /opt/modules
[[email protected] software]# cd /opt/modules
[[email protected] modules]# mv apache-storm-0.10.0 storm-0.10.0
2、配置Storm的配置文件
部署依赖环境
Java 6+
Python 2.6.6+
2.1、部署zookeeper
3.4.5+
ZK为什么要用3.4.5,因为它支持磁盘的快照和namenode的定期删除,
避免磁盘被打满
分发storm包
0.9.4+
2.2、配置storm
修改/opt/modules/storm-0.10.0/conf/目录下的storm.yaml配置文件
[[email protected] conf]# pwd
/opt/modules/storm-0.10.0/conf
[[email protected] conf]# vi storm.yaml
storm.zookeeper.servers:
- "master"
- "slave1"
- "slave2"
nimbus.host: "master"
2.3、将在master主机配置文件目录发送给slave1、slave2
[[email protected] modules]# scp -r storm-0.10.0 [email protected]:/opt/modules/storm-0.10.0
[[email protected] modules]# scp -r storm-0.10.0 [email protected]:/opt/modules/storm-0.10.0
3、启动Storm
3.1、启动Zookeeper
/opt/modules/zookeeper/bin/zkServer.sh status
/opt/modules/zookeeper/bin/zkServer.sh start
3.2、启动niumbus
[[email protected] storm-0.10.0]# cd /opt/modules/storm-0.10.0
[[email protected] storm-0.10.0]# ./bin/storm nimbus >> logs/nimbus.out 2>&1 &
[[email protected] storm-0.10.0]# tail -f logs/nimbus.log
3.3、启动Storm Web UI
[[email protected] ~]# cd /opt/modules/storm-0.10.0
[[email protected] storm-0.10.0]# ./bin/storm ui >> logs/ui.out 2>&1 &
[[email protected] storm-0.10.0]# tail -f logs/ui.log
查看Storm Web UI
在浏览器地址栏中输入:http://192.168.230.129:8080
3.4、启动supervisor
启动master中的supervisor
[[email protected] ~]# cd /opt/modules/storm-0.10.0
[[email protected] storm-0.10.0]# ./bin/storm supervisor >> logs/supervisor.out 2>&1 &
[[email protected] storm-0.10.0]# tail -f logs/supervisor.log
启动slave1中的supervisor
[[email protected] storm-0.10.0]# ./bin/storm supervisor >> logs/supervisor.out 2>&1 &
[[email protected] storm-0.10.0]# tail -f logs/supervisor.log
启动slave2中的supervisor
[[email protected] storm-0.10.0]# ./bin/storm supervisor >> logs/supervisor.out 2>&1 &
[[email protected] storm-0.10.0]# tail -f logs/supervisor.log
3.5、启动logviewer
[[email protected] storm-0.10.0]# ./bin/storm logviewer >> logs/logviewer.out 2>&1 &
[[email protected] storm-0.10.0]# tail -f logs/logviewer.log
验证:浏览器打开webUI,http://192.168.230.129:8080
3.6、在master提交topology
[[email protected] storm-0.10.0]# ./bin/storm jar examples/storm-starter/storm-starter-topologies-0.10.0.jar storm.starter.WordCountTopology wordcount
时间: 2024-09-29 01:38:17