十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
这篇文章给大家介绍如何在Docker中安装单机RocketMQ,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。
创新互联建站专业为企业提供垦利网站建设、垦利做网站、垦利网站设计、垦利网站制作等企业网站建设、网页设计与制作、垦利企业网站模板建站服务,十年垦利做网站经验,不只是建网站,更提供有价值的思路和整体网络服务。
二、 安装Docker-Compose
docker-compose 安装
github地址
dockerhub地址
$ git clone https://github.com/foxiswho/docker-rocketmq.git
$ cd ./docker-rocketmq/rmq/rmq/brokerconf/
$ vim broker.conf
修改brokerIP1=192.168.25.142
为宿主机IP,因为默认分配的Docker0的172网段,不方便外部调试
docker-compose.yml
文件位置$ cd ./docker-rocketmq/rmq
vim docker-compose.yml
docker-compose.yml
version: '3.7' services: rmqnamesrv: image: foxiswho/rocketmq:server container_name: rmqnamesrv ports: - 9876:9876 volumes: - ./rmq/logs:/opt/logs - ./rmq/store:/opt/store environment: JAVA_OPTS: " -Duser.home=/opt" JAVA_OPT_EXT: "-Xms128m -Xmx128m -Xmn128m" networks: rmq: aliases: - rmqnamesrv rmqbroker: image: foxiswho/rocketmq:broker container_name: rmqbroker ports: - 10909:10909 - 10911:10911 volumes: - ./rmq/logs:/opt/logs - ./rmq/store:/opt/store - ./rmq/brokerconf/broker.conf:/etc/rocketmq/broker.conf environment: NAMESRV_ADDR: "rmqnamesrv:9876" JAVA_OPTS: " -Duser.home=/opt" JAVA_OPT_EXT: "-server -Xms128m -Xmx128m -Xmn128m" command: mqbroker -c /etc/rocketmq/broker.conf depends_on: - rmqnamesrv networks: rmq: aliases: - rmqbroker rmqconsole: image: styletang/rocketmq-console-ng container_name: rmqconsole ports: - 8180:8080 environment: JAVA_OPTS: "-Drocketmq.namesrv.addr=rmqnamesrv:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" depends_on: - rmqnamesrv networks: rmq: aliases: - rmqconsole networks: rmq: name: rmq driver: bridge
$ docker-compose -f ./docker-compose.yml up -d
$ docker-compose -f ./docker-compose.yml ps
$ docker-compose -f ./docker-compose.yml logs rmqnamesrv|rmqbroker|rmqconsole
http://192.168.25.142:8180
关于如何在Docker中安装单机RocketMQ就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。