您好,登錄后才能下訂單哦!
這篇文章給大家介紹如何在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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。