这篇文章给大家介绍如何在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就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。