服务器之家

服务器之家 > 正文

超详细Docker Desktop下安装rocketmq的教程

时间:2021-11-21 20:19     来源/作者:zxbx

安装Docker Desktop

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

确认Docker-compose命令是否可用

docker-compose --version

超详细Docker Desktop下安装rocketmq的教程

查看docker镜像

docker search rocketmq

超详细Docker Desktop下安装rocketmq的教程

下载镜像  

apacherocketmq/rocketmq

docker pull apacherocketmq/rocketmq

编写yml文件

docker-compose.yml

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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文件

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 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部署后端时,同一个局域网不需要配置brockerIP1
brokerIP1=本机的ip

创建并启动容器

在yml所在的目录中运行

docker-compose up -d

超详细Docker Desktop下安装rocketmq的教程

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

在yml 已经将端口号改为18080

http://localhost:18080/#/

超详细Docker Desktop下安装rocketmq的教程

到此这篇关于Docker Desktop下安装rocketmq的文章就介绍到这了,更多相关Docker安装rocketmq内容请搜索服务器之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持服务器之家!

原文地址:https://blog.csdn.net/weixin_63021496/article/details/120829056

标签:

相关文章

热门资讯

yue是什么意思 网络流行语yue了是什么梗
yue是什么意思 网络流行语yue了是什么梗 2020-10-11
背刺什么意思 网络词语背刺是什么梗
背刺什么意思 网络词语背刺是什么梗 2020-05-22
2020微信伤感网名听哭了 让对方看到心疼的伤感网名大全
2020微信伤感网名听哭了 让对方看到心疼的伤感网名大全 2019-12-26
2021年耽改剧名单 2021要播出的59部耽改剧列表
2021年耽改剧名单 2021要播出的59部耽改剧列表 2021-03-05
苹果12mini价格表官网报价 iPhone12mini全版本价格汇总
苹果12mini价格表官网报价 iPhone12mini全版本价格汇总 2020-11-13
返回顶部