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 install WSL2 Ubuntu20.04 on Windows 10 and set up the docker environment

Enable WSL Make sure the system is Windows 10 200...

Linux uses stty to display and modify terminal line settings

Sttty is a common command for changing and printi...

How to use CSS to write different styles according to sub-elements

The effect we need to achieve: What is needed The...

Detailed explanation of bash command usage

On Linux, bash is adopted as the standard, which ...

A case study on MySQL optimization

1. Background A sql-killer process is set up on e...

Solution to MySQL server login error ERROR 1820 (HY000)

Fault site: Log in to the MySQL server and get th...

The use of v-model in vue3 components and in-depth explanation

Table of contents Use two-way binding data in v-m...

Implementation of CSS loading effect Pac-Man

emmm the name is just a random guess 2333 Preface...

Detailed explanation of VUE responsiveness principle

Table of contents 1. Responsive principle foundat...

Implementation of tomcat image created with dockerfile based on alpine

1. Download the alpine image [root@docker43 ~]# d...

Use VSCode's Remote-SSH to connect to Linux for remote development

Install Remote-SSH and configure it First open yo...

How to manage cached pages in Vue

Table of contents Problem 1: Destruction 1. How t...

Example of MySQL slow query

Introduction By enabling the slow query log, MySQ...