本文共 2083 字,大约阅读时间需要 6 分钟。
主机操作系统:Centos-7.3-x64zookeeper环境(已搭建好): zk1: 192.168.103.15 zk2: 192.168.103.5 zk3: 192.168.103.3主机列表: nimbus: 192.168.103.16 storm1: 192.168.103.10 storm2:192.168.103.7 storm3: 192.168.103.21jdk环境:jdk1.8
下载storm安装包(1.0.6),并解压到/opt目录下。
# wget http://apache.forsale.plus/storm/apache-storm-1.0.6/apache-storm-1.0.6.tar.gz# tar xf apache-storm-1.0.6.tar.gz -C /opt/
修改nimbus, storm1, storm2, storm3主机/etc/hosts文件
192.168.103.16 nimbus192.168.103.10 storm1192.168.103.7 storm2192.168.103.21 storm3
storm.zookeeper.port: 30000storm.zookeeper.servers: - "192.168.103.15" - "192.168.103.5" - "192.168.103.3" storm.local.dir: "/opt/apache-storm-1.0.6/status" nimbus.seeds: ["nimbus"] supervisor.slots.ports: - 6700 - 6701 - 6702 - 6703
配置文件描述
storm.zookeeper.servers
storm.zookeeper.port
storm.local.dir
nimbus.seeds
The worker nodes need to know which machines are the candidate of master in order to download topology jars and confs
主控节点,可以配置多个
supervisor.slots.ports
For each worker machine, you configure how many workers run on that machine with this config. Each worker uses a single port for receiving messages, and this setting defines which ports are open for use. If you define five ports here, then Storm will allocate up to five workers to run on this machine. If you define three ports, Storm will only run up to three. By default, this setting is configured to run 4 workers on the ports 6700, 6701, 6702, and 6703.
worker进程用于接收消息的端口
storm1,storm2, storm3执行如下指令
# cd /opt# scp -r root@nimbus:/opt/apache-storm-1.0.6 .
nimbus 节点
/opt/apache-storm-1.0.6/bin/storm nimbus 1>/dev/null 2>&1 &/opt/apache-storm-1.0.6/bin/storm ui 1>/dev/null 2>&1 &
storm1, storm2, storm3节点
/opt/apache-storm-1.0.6/bin/storm supervisor 1>/dev/null 2>&1 &
访问storm集群的ui界面
http://192.168.103.16:8080
当出现以上页面时,说明集群搭建正确。