搭建HA storm集群

各节点分配:
Nimbus Supervisor Zookeeper
CentOS15 1 1
CentOS19 1 1
CentOS20 1 1

搭建zookeeper集群:
忘记了去查之前的笔记

解压软件storm:
tar zxvf stormXXX

编辑配置文件:vim conf/storm.yaml

# limitations under the License.

storm.zookeeper.servers:
- “CentOS15”
- “CentOS19”
- “CentOS20”

storm.local.dir: “/tmp/storm”

nimbus.host: “CentOS15”

supervisor.slots.ports:
- 6700
- 6701
- 6702
- 6703

##### These MUST be filled in for a storm configuration
# storm.zookeeper.servers:
# - “CentOS15”
# - “CentOS19”
# - “CentOS20”

在storm目录中创建logs目录
$ mkdir logs

集群当中所有服务器,同步所有配置!

启动ZooKeeper集群

CentOS15上启动Nimbus(注意在/opt/storm目录下执行)
./bin/storm nimbus >> ./logs/nimbus.out 2>&1 & tail -f logs/nimbus.log
./bin/storm ui >> ./logs/ui.out 2>&1 & tail -f logs/ui.log

节点CentOS19和CentOS20启动supervisor,按照配置,每启动一个supervisor就有了4个slots
./bin/storm supervisor >> ./logs/supervisor.out 2>&1 & tail -f logs/supervisor.log
(当然node1也可以启动supervisor)

界面查看
http://node1:8080/

提交任务到Storm集群当中运行:
$ ./bin/storm jar examples/storm-starter/storm-starter-topologies-0.10.0.jar storm.starter.WordCountTopology test

环境变量可以配置也可以不配置
export STORM_HOME=/opt/sxt/storm
export PATH= PATH: STORM_HOME/bin

观察关闭一个supervisor后,nimbus的重新调度
再次启动一个新的supervisor后,观察,并rebalance

猜你喜欢

转载自blog.csdn.net/zhangfengbx/article/details/78880075