M1 Mac docker手动编译rocketmq

M1 docker手动编译rocketmq

构建rocketmq-docker镜像

  1. 拉取代码:git clone https://github.com/apache/rocketmq-docker.git

  2. cd rocketmq-docker

  3. image-20230326121523117
  4. 其中Readme.md,会有步骤介绍。

  5. cd image-build

  6. sh build-image.sh 4.8.0 alpine4.8.0 alpine是我要构建的rocketmq的版本」

  7. 通过docker images,来验证。

    image-20230326123731433

构建rocketmq-console

  1. git clone https://github.com/apache/rocketmq-dashboard.新版本已经没有rocketmq-console-ng,需要搜索rocketmq-dashboard。

  2. cd rocketmq-dashboard-master/

  3. mvn clean package -Dmaven.test.skip=true

    image-20230326123309875
  4. 将target中的jar包复制到src/main/docker中。

  5. image-20230326122221800

    创建配置文件

    image-20230326122334861
  6. 创建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-b
    brokerId = 0
    deleteWhen = 04
    fileReservedTime = 48
    brokerRole = ASYNC_MASTER
    flushDiskType = ASYNC_FLUSH
    
    # Set self-defined brokerIP address (e.g. the host node's) 
    brokerIP1=本机IP
    
  7. 创建rocketmq.yml

version: '3'
services:
  namesrv:
    image: apache/rocketmq:4.8.0-alpine
    container_name: rmqnamesrv
    ports:
      - 9876:9876
    command: sh mqnamesrv
  broker:
    image: apache/rocketmq:4.8.0-alpine
    container_name: rmqbroker
    ports:
      - 10909:10909
      - 10911:10911
      - 10912:10912
    volumes:
      - /Users/dingchuan/Documents/rocketmq/conf/broker.conf:/home/rocketmq/rocketmq-4.8.0/conf/broker.conf
       - /Users/dingchuan/Documents/rocketmq/logs:/home/rocketmq/logs
      - /Users/dingchuan/Documents/rocketmq/store:/home/rocketmq/store
    command: sh mqbroker -n namesrv:9876 -c /home/rocketmq/rocketmq-4.8.0/conf/broker.conf
    depends_on:
      - namesrv
  mqconsole:
    image: candice0630/rocketmq-console-ng:2.0
    container_name: rmqconsole
    ports:
      - 8181:8080
    environment:
      JAVA_OPTS: -Drocketmq.config.namesrvAddr=namesrv:9876 -Drocketmq.config.isVIPChannel=false
    depends_on:
      - namesrv
  • 要修改配置文件volumes中的/Users/dingchuan/Documents/rocketmq/conf/broker.conf,改成步骤二自己创建的broker.conf的路径
  • image的版本,根据第1步构建的rocketmq-docker镜像来修改,此处选择4.8.0-alpine
  1. 通过rocketmq.yml构建镜像组:docker-compose -f rocketmq.yml up -d

    image-20230326123424347
  2. 回到docker desktop 验证。

    image-20230326123525544
  3. console验证。

    image-20230326123618547

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 9
    评论
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值