docker for rocketmq

#下载服务器
docker pull foxiswho/rocketmq:server
docker pull foxiswho/rocketmq:broker

#下载客户端
docker pull styletang/rocketmq-console-ng

#启动 rocketmq server 容器
docker run -d -p 9876:9876 --name rmqserver  foxiswho/rocketmq:server

#启动 rocketmq broker 容器
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 -Xmn128m" foxiswho/rocketmq:broker

#broker 配置文件位置 (容器内)
/etc/rocketmq/broker.conf

#使用自己的配置文件
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 -Xmn128m" \
-v /User/fox/rmq/conf/broker.conf:/etc/rocketmq/broker.conf \
foxiswho/rocketmq:broker

#启动 rocketmq console 容器
docker run --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

#浏览器访问
localhost:8180

#ps 这里使用link连接,但是推荐使用network

#集成java
https://blog.csdn.net/fenglailea/article/details/82692928

#修改配置文件,增加一行brokerIP1 = 127.0.0.1
docker cp  rmqbroker:/etc/rocketmq/broker.conf f:\\
docker cp f:\\broker.conf rmqbroker:/etc/rocketmq/broker.conf

你可能感兴趣的:(docker)