RocketMQ is a distributed, queue-based messaging middleware designed by Alibaba with the following features:
In fact, the editor feels that RocketMQ should be chosen because it has withstood the test of Tmall Double Eleven's massive message volume many times. In addition, it has the ability to accumulate billions of messages. Such a powerful component is a new dark horse! Next, I will show you how to install rocketMQ using docker on centos7. 1. Install NamesrvPull the image docker pull rocketmqinc/rocketmq:4.4.0 Create a new folder mq in the /usr/local directory Command: Start the container docker run -d -p 9876:9876 -v {your own path}/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 As shown below, my own path is /usr/local/mq You can customize the path yourself. Just replace the path Precautions {your own path} should be replaced with the location where you want to save MQ logs and data on your host machine. 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 saved in the memory of the container runtime by default, and returns to the original starting point after restart. 2. Install brokerCreate broker.conf file 1: Create the broker.conf file in the {own path}/conf directory Enter the previous /usr/local/mq directory and enter the command mkdir conf to create a new conf directory Then enter the command touch broker.conf in the conf directory to create a new file Enter the command vi broker.conf and click the insert key on the keyboard to start inserting. Write the following in broker.conf brokerClusterName = DefaultCluster brokerName = broker-a brokerId = 0 deleteWhen = 04 fileReservedTime = 48 brokerRole = ASYNC_MASTER flushDiskType = ASYNC_FLUSH brokerIP1 = {local public IP} (My server is Alibaba Cloud, the arrow indicates the public IP address) After entering, press the Esc key, press shift, and then press v Type wq! to exit Start the container docker run -d -p 10911:10911 -p 10909:10909 -v {your own path}/data/broker/logs:/root/logs -v {your own path}/rocketmq/data/broker/store:/root/store -v {your own path}/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 Precautions Notice: { Your own path } is the same as the previous step and will not be repeated here. The brokerIP1 in the broker.conf file is the ip of your broker registered in Namesrv. If not specified, it will take the internal IP address of the container by default. Unless your application is also deployed in a container that is connected to the network, you will not be able to connect to the broker service locally or outside the container, which will lead to various exceptions such as RemotingTooMuchRequestException. 3. Install RocketMQ consolePull the image docker pull styletang/rocketmq-console-ng View mirror docker ps Start the RocketMQ console docker run -e "JAVA_OPTS=-Drocketmq.namesrv.addr=server public network ip:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 8080:8080 -t styletang/rocketmq-console-ng View the running status The status is up , indicating successful operation. docker ps -a Browser access Remember to open ports in the firewall You may also be interested in:
|
<<: A brief discussion on VUE uni-app template syntax
>>: XHTML Getting Started Tutorial: Commonly Used XHTML Tags
If you want to adjust the size and number of Inno...
Install vsftpd $ sudo apt-get install vsftpd -y S...
1. Single column index Choosing which columns to ...
Table of contents Preface Creating a component li...
Table of contents Water wave effect Let's see...
Preface In terms of layout, Gobang is much simple...
This article shares the specific code for JavaScr...
Table of contents 1 What is container cloud? 2 In...
Table of contents VARCHAR and CHAR Types Conclusi...
Effect: <!doctype html> <html> <he...
Sometimes, in order to facilitate the export and ...
1. Install the express library and generator Open...
Ellipses appear when multi-line text overflows Th...
watch : listen for data changes (change events of...
background: As a DBA, most of the DDL changes of ...