docker run -d -p 9876:9876 --name rmqserver foxiswho/rocketmq:server-4.5.1
docker run -d -p 10911:10911 -p 10909:10909
--name rmqbroker --link rmqserver:namesrv
-e "NAMESRV_ADDR=namesrv:9876" -e "JAVA_OPTS=-Duser.home=/opt"
-e "JAVA_OPT_EXT=-server -Xms128m -Xmx128m"
foxiswho/rocketmq:broker-4.5.1
修改配置文件: /etc/rocketmq/broker.conf
brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
brokerIP1 = 192.168.228.130 //指定虚拟机的ip,虚拟机网络用的是NAT模式
namesrvAddr = 172.17.0.2:9876
docker run -d --name rmqconsole -p 8180:8080 --link rmqserver:namesrv -e "JAVA_OPTS=-Drocketmq.namesrv.addr=namesrv:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -t styletang/rocketmq-console-ng
现在的问题是,如果brokerIP1指定虚拟机的IP,那rocketmq-console无法连接,如果brokerIP1指定docker内部ip(172.17.0.3),那java客户端连不上rocketmq
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…