RocketMQ docker

1. 安装 Namesrv 

docker run -d -p 9876:9876 -v F:/testing/rocketmq/logs:/root/logs -v F:/testing/rocketmq/namesrv/store:/root/store --name rmqnamesrv -e "MAX_POSSIBLE_HEAP=100000000" rocketmqinc/rocketmq:4.4.0 sh mqnamesrv

2. 安装 broker 服务器

创建 broker.conf 文件

  1. 在 {RmHome}/conf 目录下创建 broker.conf 文件
  2. 在 broker.conf 中写入如下内容
brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
brokerIP1 = {本地外网 IP}  // 注意此处为容器内IP
docker run -d -p 10911:10911 -p 10909:10909 -v  F:/testing/rocketmq/broker/logs:/root/logs -v  F:/testing/rocketmq/broker/store:/root/store -v  F:/testing/rocketmq/conf/broker.conf:/opt/rocketmq-4.4.0/conf/broker.conf --name rmqbroker --link rmqnamesrv:namesrv -e "NAMESRV_ADDR=namesrv:9876" -e "MAX_POSSIBLE_HEAP=200000000" rocketmqinc/rocketmq:4.4.0 sh mqbroker -c /opt/rocketmq-4.4.0/conf/broker.conf

3. 安装 rocketmq 控制台

docker run -itd -e "JAVA_OPTS=-Drocketmq.namesrv.addr=172.17.0.5:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 8020:8080 --name rocketmq-console pangliang/rocketmq-console-ng

// 注意此处为容器内IP


 

你可能感兴趣的:(docker)