docker 部署rocketmq 4.4
1 mkdir -p /home/rocketmq/{name_server,broker,console}
2 mkdir -p /home/rocketmq/name_server/{logs,store}
3 mkdir -p /home/rocketmq/broker/{logs,store,conf}
4 docker run --name name_server \
--restart=always \
-p 9876:9876 \
--privileged=true \
-v /home/rocketmq/name_server/logs:/root/logs \
-v /home/rocketmq/name_server/store:/root/store \
-e "MAX_POSSIBLE_HEAP=100000000" \
-d rocketmqinc/rocketmq:4.4.0 sh mqnamesrv autoCreateTopicEnable=true
5 vim /home/rocketmq/rocketmq_broker/conf/broker.conf
namesrvAddr=172.24.187.132:9876
brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
brokerIP1 = 172.24.187.132
listenPort=10911
6 docker run --name rocketmq_broker \
--restart=always \
-p 10911:10911 -p 10909:10909 \
--privileged=true \
-v /home/rocketmq/broker/logs:/root/logs \
-v /home/rocketmq/broker/store:/root/store \
-v /home/rocketmq/broker/conf/broker.conf:/opt/rocketmq-4.4.0/conf/broker.conf \
-e "NAMESRV_ADDR=172.24.187.132:9876" \
-e "MAX_POSSIBLE_HEAP=200000000" \
-d rocketmqinc/rocketmq:4.4.0 sh mqbroker autoCreateTopicEnable=true \
7 mkdir /home/docker/mount/rocketmq/console/data (为控制台设置密码)
vim users.properties
# This file supports hot change, any change will be auto-reloaded without Console restarting.
# Format: a user per line, username=password[,N] #N is optional, 0 (Normal User); 1 (Admin)
# Define Admin
# =============用户名和密码规则「用户名=密码,权限」,这里的权限为1表示管理员,为0表示普通用户=============
# 例如:admin=admin123,1
admin=admin,1
user=user,0
8 docker run -d --name rocketmq-console -v /home/docker/mount/rocketmq/console/data:/tmp/rocketmq-console/data -e "JAVA_OPTS=-Drocketmq.namesrv.addr=172.24.187.132:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false -Drocketmq.config.loginRequired=true" -p 12001:8080 apacherocketmq/rocketmq-dashboard:latest (运行控制台)