Docker配置RocketMQ
Docker配置RocketMQ
1、拉取RocketMQ镜像
1 | docker pull foxiswho/rocketmq:broker-4.5.1 |
2、启动注册中心Nameserver
1 | docker run -d -p 9876:9876 --name rmqserver foxiswho/rocketmq:server-4.5.1 |
3、创建RocketMQ配置文件
1 | //或者本地创建后上传到云主机上,路径可以根据自己设定 |
1 | brokerIP1 = 填写你的云主机ip |
4、启动RocketMQ
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" -v /usr/local/rocketmq/conf/broker.conf:/etc/rocketmq/broker.conf foxiswho/rocketmq:broker-4.5.1 |
5、拉取RocketMQ-dashboard镜像
1 | docker pull pangliang/rocketmq-console-ng |
6、启动dashboard
1 | docker run -d --name rmqconsole -p 8180:8080 --link rmqserver:namesrv -e "JAVA_OPTS=-Drocketmq.namesrv.addr=namesrv:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -t pangliang/rocketmq-console-ng |
7、dashboard中添加topic
1 | http://xxx.xxx.xxx.xxx:8180 |
8、检查
1 | //检查服务运行状况 |
1 | //检查服务运行是否成功、依次检查Nameserver、RocketMQ、RocketMQ-dashboard(暂不演示) |
参考链接
评论