rocketmq 集群环境搭建配置

rocketmq环境搭建配置:

一.   搭建三主集群,环境:centos-64 7.4 + RocketMQ-4.3.2

Master01: 192.168.102.68

Master02: 192.168.102.69

Master03: 192.168.102.70

配置hosts解析,并同时保证三台机器之间是互通的:

# vim  /etc/hosts

192.168.102.68  rocket-nameserver-01

192.168.102.69  rocket-nameserver-02

192.168.102.70  rocket-nameserver-03

二. 下载安装

http://mirrors.shu.edu.cn/apache/rocketmq/4.3.2/rocketmq-all-4.3.2-bin-release.zip

  1. 解压缩后放到指定目录下,目录可自定义:

# unzip rocketmq-all-4.3.2-bin-release

# mv rocketmq-all-4.3.2-bin-release  /opt/rocketmq432

# cd /opt/rocketmq432

2. 在rocketmq432创建所需要的文件夹

#mkdir store

#mkdir store/commitlog

#mkidr store/consumequeue

#mkdir store/index

  1. 修改配置文件,三台机器都需要分别进行配置 :

# /opt/rocketmq432/conf/2m-noslave

#pwd

# ls

broker-a.properties  broker-b.properties  broker-c.properties

配置broker-a.properties

broker-b.properties 和 broker-c.properties的配置也是一样,唯一不同的地方就是

 

brokerName=broker-b和brokerName=broker-c

 

去/opt/rocketmq432/bin目录下执行:

 

启动a:

1. nohup sh mqnamesrv &

 

2. nohup sh mqbroker -c /opt/rocketmq432/conf/2m-noslave/broker-a.properties autoCreateTopicEnable=true >/tmp/logs/mq.log 2>&1 &

 

 

 

启动b:

1. nohup sh mqnamesrv &

 

2. nohup sh mqbroker -c /opt/rocketmq432/conf/2m-noslave/broker-b.properties autoCreateTopicEnable=true >/tmp/logs/mq.log 2>&1 &

 

启动c:

 

1. nohup sh mqnamesrv &

 

2. nohup sh mqbroker -c /opt/rocketmq432/conf/2m-noslave/broker-c.properties autoCreateTopicEnable=true >/tmp/logs/mq.log 2>&1 &

 

 

 

 

停止服务:

先执行: sh mqshutdown broker

 

再执行: sh mqshutdown namesrv

 

 

 

消息队列样例测试导入:

 

export NAMESRV_ADDR=localhost:9876

sh bin/tools.sh org.apache.rocketmq.example.quickstart.Producer

 

sh bin/tools.sh org.apache.rocketmq.example.quickstart.Consumer

也可以安装 RockeyMq-console对MQ的状况进行查看:

rocketmq 集群环境搭建配置rocketmq 集群环境搭建配置

rocketmq 集群环境搭建配置

上一篇:vue 15分钟倒计时


下一篇:js:字符串(string)转json