千家信息网

Docker Desktop下怎么安装rocketmq

发表于:2025-01-19 作者:千家信息网编辑
千家信息网最后更新 2025年01月19日,这篇文章主要介绍了Docker Desktop下怎么安装rocketmq,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。安装Docker
千家信息网最后更新 2025年01月19日Docker Desktop下怎么安装rocketmq

这篇文章主要介绍了Docker Desktop下怎么安装rocketmq,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

安装Docker Desktop

下载地址:Docker Desktop for Mac and Windows | Docker

确认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 = DefaultClusterbrokerName = broker-abrokerId = 0deleteWhen = 04fileReservedTime = 48brokerRole = ASYNC_MASTERflushDiskType = ASYNC_FLUSH#使用docker-compose部署后端时,同一个局域网不需要配置brockerIP1brokerIP1=本机的ip

创建并启动容器

在yml所在的目录中运行

docker-compose up -d

可视化客户端(默认端口号8080)

在yml 已经将端口号改为18080

http://localhost:18080/#/

感谢你能够认真阅读完这篇文章,希望小编分享的"Docker Desktop下怎么安装rocketmq"这篇文章对大家有帮助,同时也希望大家多多支持,关注行业资讯频道,更多相关知识等着你来学习!

0