Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to quickly build a rocketmq environment through docker

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article focuses on "how to quickly build a rocketmq environment through docker". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to quickly build a rocketmq environment through docker.

1. Install Namesrv pull image docker pull rocketmqinc/rocketmq: 4.4.0` launch container docker run-d-p 9876VR 9876-v {RmHome} / data/namesrv/logs:/root/logs-v {RmHome} / data/namesrv/store:/root/store-- name rmqnamesrv-e "MAX_POSSIBLE_HEAP=100000000" rocketmqinc/rocketmq:4.4.0 sh mqnamesrv considerations

To replace    {RmHome} with the place where your host wants to save MQ logs and data, use the volume function through the-v parameter of docker to map your local directory to the directory in the container. Otherwise, all data is stored in the memory of the container runtime by default, and after reboot, it will go back to its original starting point.

two。 Install broker server pull image

It is the same image as the previous step. If the previous step is completed, this step does not need to be pulled.

Create a broker.conf file

Create a broker.conf file in the {RmHome} / conf directory

Write the following in broker.conf

BrokerClusterName = DefaultClusterbrokerName = broker-abrokerId = 0deleteWhen = 04fileReservedTime = 48brokerRole = ASYNC_MASTERflushDiskType = ASYNC_FLUSHbrokerIP1 = {local public network IP}

BrokerIP1 will be changed to IP of your own host.

Launch the container docker run-d-p 10911 RmHome 10911-p 10909-v {RmHome} / data/broker/logs:/root/logs-v {RmHome} / rocketmq/data/broker/store:/root/store-v {RmHome} / conf/broker.conf:/opt/rocketmq-4.4.0/conf/broker.conf-- name rmqbroker-- link rmqnamesrv:namesrv-e "NAMESRV_ADDR=namesrv:9876"-e "MAX_POSSIBLE_HEAP=200000000" rocketmqinc/rocketmq:4.4. 0 sh mqbroker-c / opt/rocketmq-4.4.0/conf/broker.conf considerations

Note: {RmHome} is no longer described as in the previous step. The brokerIP1 in broker.conf 's file is the ip that your broker registers with Namesrv. If it is not specified, he will default to the private network IP in the container. Unless your application is also deployed in a network-connected container, the broker service cannot be connected locally or outside the container, resulting in various exceptions such as RemotingTooMuchRequestException.

3. Install the rocketmq console to pull the image docker pull pangliang/rocketmq-console-ng startup container docker run-e "JAVA_OPTS=-Drocketmq.namesrv.addr= {local public network IP}: 9876-Dcom.rocketmq.sendMessageWithVIPChannel=false"-p 8080docker run 8080-t pangliang/rocketmq-console-ng here. I believe you have a deeper understanding of "how to quickly build a rocketmq environment through docker". You might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report