RocketMQ - 安装
# Docker 安装
# 安装 NameServer
mkdir /docker/rocketmq/nameserver/logs
mkdir /docker/rocketmq/nameserver/store
docker pull rocketmqinc/rocketmq:latest
docker run -d -p 9876:9876 \
--restart=always \
--name rmqnamesrv \
-v /docker/rocketmq/nameserver/logs:/root/logs \
-v /docker/rocketmq/nameserver/store:/root/store \
-e "MAX_POSSIBLE_HEAP=100000000" \
rocketmqinc/rocketmq:latest \
sh mqnamesrv
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
# 安装 Broker
创建 broker.conf 文件:
# broker集群名称
brokerClusterNam = DefaultCluster
# broker节点名称
brokerName = broker-a
# broker节点id
brokerId = 0
# 删除条件?这个还不清楚用途,后续研究下
deleteWhen = 04
# 文件保留时间(单位小时),默认为3天
fileReservedTime = 48
# broker角色
brokerRole = ASYNC_MASTER
# 磁盘同步方式:同步,异步
flushDiskType = ASYNC_FLUSH
# 当前broker监听的IP(主)
brokerIP1 = 192.168.199.32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 创建数据卷
mkdir /docker/rocketmq/broker/logs
mkdir /docker/rocketmq/broker/store
mkdir /docker/rocketmq/broker/conf/
vi /docker/rocketmq/broker/conf/broker.conf
# -- 文件内容 开始 --
# broker集群名称
brokerClusterNam = DefaultCluster
# broker节点名称
brokerName = broker-a
# broker节点id
brokerId = 0
# 删除条件?这个还不清楚用途,后续研究下
deleteWhen = 04
# 文件保留时间(单位小时),默认为3天
fileReservedTime = 48
# broker角色
brokerRole = ASYNC_MASTER
# 磁盘同步方式:同步,异步
flushDiskType = ASYNC_FLUSH
# 当前broker监听的IP(主)
brokerIP1 = 192.168.199.32
# -- 文件内容 结束 --
docker pull rocketmqinc/rocketmq:latest
# 启动项目
docker run -d --name rmqbroker \
--restart=always \
-p 10911:10911 -p 10909:10909 \
--link rmqnamesrv:namesrv \
-e "NAMESRV_ADDR=namesrv:9876" \
-v /docker/rocketmq/broker/logs:/root/logs \
-v /docker/rocketmq/broker/store:/root/store \
-v /docker/rocketmq/broker/conf/broker.conf:/opt/rocketmq/conf/broker.conf \
-e "MAX_POSSIBLE_HEAP=200000000" \
rocketmqinc/rocketmq:latest \
sh mqbroker -c /opt/rocketmq/conf/broker.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# 安装可视化控制台
docker pull docker pull rocketmqinc/rocketmq:latest
docker run -d --name rocketmq-console \
--restart=always \
-p 8000:8080 \
-e "JAVA_OPTS=-Drocketmq.config.namesrvAddr=192.168.199.32:9876 -Drocketmq.config.isVIPChannel=false" \
-t styletang/rocketmq-console-ng
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
其中 -Drocketmq.config.namesrvAddr
指定为自己服务器的 IP + RocketMQ 端口(部署 RocketMQ 的服务器 IP + RocketMQ 端口)
最后访问可视化控制台:http://192.168.199.32:9876
。
编辑此页 (opens new window)
更新时间: 2023/10/23, 10:58:52