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

Docker installation rocketMQ and how to deal with the problems in the installation process

2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

Editor to share with you about the installation of docker rocketMQ and how to deal with the problems in the installation process. I hope you will get something after reading this article. Let's discuss it together.

This article mainly introduces the installation of rocketMQ4.4.0, which is divided into four steps:

1. Pull the rocketmq image.

2. Create namesrv.

3. Create a broker node. What I introduce here is how to create a single broker.

4. RocketMQ-console service, which is used to manage the rocketMQ management interface.

Pull rocketmq image

The docker command is as follows

Docker pull rocketmqinc/rocketmq:4.4.0 creates namesrv

Docker command

Docker run-d-- name rmqnamesrv-p 9876 Zhou 9876-v C:\ data\ rocketmq\ logs:/root/logs-v C:\ data\ rocketmq\ store:/root/store-e "MAX_POSSIBLE_HEAP=100000000" rocketmqinc/rocketmq:4.4.0 sh mqnamesrv

Parameter interpretation

Parameter description-d starts as daemon-name sets container name-p container port 9876 maps to native port 9876-v maps container / root/logs (log file) directory to local corresponding path / container / root/store (data storage) directory to local corresponding path-e sets container maximum heap memory to 100000000rocketmqinc/rocketmq:4.4.0 image Name: version sh startup service mqnamesrv creates a single broker node

Docker command

Docker run-d-- name rmqbroker-- link rmqnamesrv:namesrv-p 10911 privileged=true-v C:\ data\ broker\ logs:/root/logs-v C:\ data\ broker\ store:/root/store-v C:\ data\ broker\ conf\ broker.conf:/opt/rocketmq-4.4.0/conf/broker.conf-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

Parameter interpretation

Parameter description-d starts as a daemon-name sets the name of the container-- link communicates with the rmqnamesrv container-p 10911 maps the container's non-VIP communication port 10911 to native port 10911-p 10909 rmqnamesrv port 10909 maps the container's VIP communication port 1090 to native port 10909-privileged=true setting allows mounting of private folders-v maps the container / root/logs (log file) directory to this Mapping the container / root/store (data storage) directory to the local corresponding path / mapping the container / opt/rocketmq-4.4.0/conf/broker.conf configuration file to the local corresponding path (you can modify the broker.conf file on the local machine each time Restart the container)-e "NAMESRV_ADDR=namesrv:9876" specify the address of the namesrv as the native 9876lice "MAX_POSSIBLE_HEAP=200000000" set the maximum heap memory of the broker service to the 200000000rocketmqinc/rocketmq:4.4.0 image name: version sh mqbroker startup service mqbroker-c / opt/rocketmq-4.4.0/conf/broker.conf specify the configuration file to launch the broker

Broker.conf file configuration

# if more nodes can be configured with multiple brokerClusterName = DefaultCluster#broker names, master and slave use the same name, indicating that their master-slave relationship brokerName = broker-a#0 indicates Master, and a value greater than 0 indicates when to delete messages. The default is the length of time for deleteWhen = 0 minutes to keep messages on disk at 4: 00 a.m., in hours, fileReservedTime = 4 minutes. There are three values: SYNC_MASTER,ASYNC_MASTER,SLAVE Synchronous and asynchronous indicate the mechanism of synchronous data between Master and Slave; brokerRole = ASYNC_MASTER# flushing policy. Values are: ASYNC_FLUSH,SYNC_FLUSH indicates synchronous flushing and asynchronous flushing; SYNC_FLUSH message is returned to the successful status only after it is written to disk, ASYNC_FLUSH is not required; flushDiskType = ASYNC_FLUSH# sets the ip address of the server where the broker node resides namesrvAddr = native ip address: 9876brokerIP1 = native ip address

If the namesrvAddr configuration is not added to the broker.conf configuration file, the following error will be reported when running the program:

Exception in thread "main" org.apache.rocketmq.remoting.exception.RemotingTooMuchRequestException: sendDefaultImpl call timeout

At org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendDefaultImpl (DefaultMQProducerImpl.java:588)

At org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send (DefaultMQProducerImpl.java:1223)

At org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send (DefaultMQProducerImpl.java:1173)

At org.apache.rocketmq.client.producer.DefaultMQProducer.send (DefaultMQProducer.java:214)

At com.baojian.mob.base.producer.SyncProducer.main (SyncProducer.java:41)

1522 result 31.455 [NettyClientSelector_1] INFO RocketmqRemoting-closeChannel: close the connection to remote address [] result: true

15 NettyClientSelector_1 22 closeChannel 32.049 [NettyClientSelector_1] result: true: close the connection to remote address [] result:

RocketMQ-console service

Docker command

You can directly execute the docker run command without using the docker pull command to pull the image. If the image does not exist, the image will be pulled first and docker run will be executed.

Docker run-d-name rmqadmin-e "JAVA_OPTS=-Drocketmq.namesrv.addr=172.16.122.115:9876-Dcom.rocketmq.sendMessageWithVIPChannel=false"-p 8081 JAVA_OPTS=-Drocketmq.namesrv.addr=172.16.122.115:9876 8080 pangliang/rocketmq-console-ng

Parameter description

Description-d starts as a daemon-- name sets the name of the container-e "JAVA_OPTS=-Drocketmq.namesrv.addr=172.16.122.115:9876 sets the IP address of the namesrv service-Dcom.rocketmq.sendMessageWithVIPChannel=false" does not use the VIP channel to send messages-p 8081 namesrv 8080 maps port 8080 in the container to port 8081 on the host

Rocketmq-console interface

After the container runs successfully, open http://127.0.0.1:8081 using a browser to enter the rokcetmq-console management interface, and see the cluster information, indicating that rocketmq has been installed successfully.

Error reporting problem in rocketmq-console producer Interface

Click search to report an error because the producer closed it using producer.shutdown () after creating the production group and logged out the following code.

After reading this article, I believe you have a certain understanding of "docker installation rocketMQ and how to deal with problems in the installation process". If you want to know more related knowledge, welcome to follow the industry information channel, thank you for reading!

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

Development

Wechat

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

12
Report