docker启动rocketmq
- 打开云服务器防火墙 配置外网访问
- 创建容器外部存储文件:
mkdir -p /root/rocketmq/data/namesrv/logs /root/rocketmq/data/namesrv/store /root/rocketmq/conf /root/rocketmq/data/broker/logs /root/rocketmq/data/broker/store
- 进入到 /root/rocketmq/conf 文件夹下 创建文件 broker.conf
cd /root/rocketmq/conf touch broker.conf
编辑 broker.conf 文件:
brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
brokerIP1 = {本地外网 IP}
- 拉取镜像
docker pull rocketmqinc/rocketmq:4.4.0 docker pull styletang/rocketmq-console-ng
- 创建namesrv
docker run -d -p 9876:9876 -v /root/rocketmq/data/namesrv/logs:/root/logs -v /root/rocketmq/data/namesrv/store:/root/store --name rmqnamesrv -e "MAX