A very detailed tutorial on installing rocketmq under Docker Desktop

A very detailed tutorial on installing rocketmq under Docker Desktop

Install Docker Desktop

Download address: Docker Desktop for Mac and Windows | Docker

Confirm whether the Docker-compose command is available

docker-compose --version

View Docker images

docker search rocketmq

Download image

ApacheRocketMQ/RocketMQ

docker pull apacherocketmq/rocketmq

Write yml file

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:
 
      -namerv
 
  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:
 
      -namerv

No tag is specified in docker, the installation time is 2021-10-13, and the latest version is 4.6.0, so modify the above configuration file to the 4.6.0 directory

Configure broker.conf in the D:/rocketmq/broker/conf/ directory

-D:/rocketmq/broker/conf/broker.conf:/home/rocketmq/rocketmq-4.6.0/conf/broker.conf

broker.conf file

# 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
#When using docker-compose to deploy the backend, brokerIP1 does not need to be configured in the same LAN
brokerIP1=localhost's IP

Create and start a container

Run in the directory where yml is located

docker-compose up -d

Visual client (default port number 8080)

The port number has been changed to 18080 in yml

http://localhost:18080/#/

This is the end of this article about installing rocketmq under Docker Desktop. For more information about installing rocketmq under Docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Installing Docker Desktop reports an error message: WSL 2 installation is incomplete (Solve the error message)
  • Solution to Docker Desktop startup failure (Docker failed to initialize Docker Desktop is shutting down)

<<:  How to create Baidu dead link file

>>:  Perfect solution to Google Chrome autofill problem

Recommend

How to modify mysql permissions to allow hosts to access

Enable remote access rights for mysql By default,...

What to do if you forget the initial password when installing MySQL on Mac

Forgetting the password is a headache. What shoul...

CSS3 simple cutting carousel picture implementation code

Implementation ideas First, create a parent conta...

How to build pptpd service in Alibaba Cloud Ubuntu 16.04

1. To build a PPTP VPN, you need to open port 172...

Summary of the differences and usage of plugins and components in Vue

The operating environment of this tutorial: Windo...

Beginners learn some HTML tags (2)

Related article: Beginners learn some HTML tags (1...

How to set up Windows Server 2019 (with pictures and text)

1. Windows Server 2019 Installation Install Windo...

How to add double quotes in HTML title

<a href="https://www.jb51.net/" titl...

What are the drawbacks of deploying the database in a Docker container?

Preface Docker has been very popular in the past ...

Detailed explanation of Vue life cycle functions

Table of contents Lifecycle Functions Common life...

How to use shtml include

By applying it, some public areas of the website c...

Share the responsive frameworks commonly used by web design masters (summary)

This article introduces and shares the responsive...