這篇文章給大家介紹如何在Docker中安裝單機RocketMQ,內(nèi)容非常詳細,感興趣的小伙伴們可以參考借鑒,希望對大家能有所幫助。
創(chuàng)新互聯(lián)建站專業(yè)為企業(yè)提供墾利網(wǎng)站建設(shè)、墾利做網(wǎng)站、墾利網(wǎng)站設(shè)計、墾利網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計與制作、墾利企業(yè)網(wǎng)站模板建站服務(wù),十年墾利做網(wǎng)站經(jīng)驗,不只是建網(wǎng)站,更提供有價值的思路和整體網(wǎng)絡(luò)服務(wù)。
二、 安裝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網(wǎng)段,不方便外部調(diào)試
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
關(guān)于如何在Docker中安裝單機RocketMQ就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學(xué)到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。