超詳細(xì)Docker Desktop下安裝rocketmq的教程
安裝Docker Desktop
下載地址:Docker Desktop for Mac and Windows | Docker
確認(rèn)Docker-compose命令是否可用
docker-compose --version

查看docker鏡像
docker search rocketmq

下載鏡像
apacherocketmq/rocketmq
docker pull apacherocketmq/rocketmq
編寫yml文件
docker-compose.yml
services:
namesrv:
image: apacherocketmq/rocketmq
container_name: rmqnamesrv
ports:
- 9876:9876
volumes:
- D:/rocketmq/namesrv/logs:/home/rocketmq/logs
command: sh mqnamesrv
broker:
image: apacherocketmq/rocketmq
container_name: rmqbroker
ports:
- 10909:10909
- 10911:10911
- 10912:10912
volumes:
- D:/rocketmq/broker/logs:/home/rocketmq/logs
- D:/rocketmq/broker/store:/home/rocketmq/store
- D:/rocketmq/broker/conf/broker.conf:/home/rocketmq/rocketmq-4.6.0/conf/broker.conf
environment:
NAMESRV_ADDR: "namesrv:9876"
JAVA_OPTS: " -Duser.home=/opt"
JAVA_OPT_EXT: "-server -Xms128m -Xmx128m -Xmn128m"
command: sh mqbroker -n namesrv:9876 -c ../conf/broker.conf
depends_on:
- namesrv
rmqconsole:
image: styletang/rocketmq-console-ng
container_name: rmqconsole
ports:
- 18080:8080
environment:
JAVA_OPTS: "-Drocketmq.namesrv.addr=namesrv:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false"
depends_on:
- namesrv
docker中沒有指定tag,安裝時間為2021-10-13,使用latest,是4.6.0,所以修改上述配置文件到4.6.0目錄
在D:/rocketmq/broker/conf/目錄下配置broker.conf
-D:/rocketmq/broker/conf/broker.conf:/home/rocketmq/rocketmq-4.6.0/conf/broker.conf
broker.conf文件
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. brokerClusterName = DefaultCluster brokerName = broker-a brokerId = 0 deleteWhen = 04 fileReservedTime = 48 brokerRole = ASYNC_MASTER flushDiskType = ASYNC_FLUSH #使用docker-compose部署后端時,同一個局域網(wǎng)不需要配置brockerIP1 brokerIP1=本機的ip
創(chuàng)建并啟動容器
在yml所在的目錄中運行
docker-compose up -d

可視化客戶端(默認(rèn)端口號8080)
在yml 已經(jīng)將端口號改為18080
http://localhost:18080/#/

到此這篇關(guān)于Docker Desktop下安裝rocketmq的文章就介紹到這了,更多相關(guān)Docker安裝rocketmq內(nèi)容請搜索本站以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持本站!
版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。
關(guān)注官方微信