rocketmq通过docker安装

2022-04-18 10:19:27 浏览数 (1)

测试可用。最后的安装效果

image.pngimage.png

我是使用-host模式的,可以使用其他模式。

本机安装

安装2个镜像

代码语言:txt复制
docker pull rocketmqinc/rocketmq
docker pull styletang/rocketmq-console-ng 
  1. 安装name-server(服务发现用的,类似zookeeper)
  2. 安装broker(队列服务器)
代码语言:scss复制
docker run -d --net=host -p 9876:9876 -v /data0/soft_app/rocketmq/data/namesrv/logs:/root/logs -v /data0/soft_app/rocketmq/data/namesrv/store:/root/store --name rmqnamesrv -e "JAVA_OPT_EXT=-Xms512M -Xmx512M -Xmn128m" -e "MAX_POSSIBLE_HEAP=100000000" rocketmqinc/rocketmq sh mqnamesrv
docker run -d --net=host -p 10911:10911 -p 10909:10909 -v  /data0/soft_app/rocketmq/data/broker/logs:/root/logs -v  /data0/soft_app/rocketmq/rocketmq/data/broker/store:/root/store -v  /data0/soft_app/rocketmq/conf/broker.conf:/opt/rocketmq/conf/broker.conf --name rmqbroker  -e "JAVA_OPT_EXT=-Xms512M -Xmx512M -Xmn128m" -e "MAX_POSSIBLE_HEAP=200000000" rocketmqinc/rocketmq sh mqbroker -c /opt/rocketmq/conf/broker.conf
docker run -d --net=host -e "JAVA_OPTS=-Drocketmq.namesrv.addr=127.0.0.1:9876 -Dserver.port=8183 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 8183:8183 -t styletang/rocketmq-console-ng --name rocketmq-console-ng

测试环境

http://127.0.0.1:8183/#/topic

配置broker的conf

代码语言:scss复制
brokerClusterName = DefaultCluster
namesrvAddr=127.0.0.1:9876
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
brokerIP1 = 127.0.0.1

0 人点赞