Introduction and installation of RocketMQ

1 Introduction and installation of RocketMQ

1.1 Introduction to RocketMQ

Apache RocketMQ is a distributed messaging system developed by the Java language, developed by the Alibaba team, and contributed to
Apache at the end of 2016, becoming a top-level project of Apache.
Inside Ali, RocketMQ has served thousands of applications, large and small, of the group. On Double Eleven every year, an incredible trillion-level
message is circulated through RocketMQ (on Double Eleven in 2017, the entire Ali Baba Group's online news flow through RocketMQ has reached trillions
, and the peak TPS has reached 56 million), which plays a pivotal role in Ali's big, medium and Taiwan strategies.
Address: http://rocketmq.apache.org/, as shown in the figure:insert image description here

1.2 Historical development of RocketMQ

Alibaba's messaging middleware originated from the Wucaishi project in 2001, during which Notify came into being for the circulation of core transaction messages.
In 2010, B2B began to use ActiveMQ as the message core on a large scale. With the rapid development of Ali's business, there was an urgent need for a message middleware that supports sequential messages and has the ability to accumulate massive messages. MetaQ 1.0 was born in 2011.
In 2012, MetaQ has developed to version 3.0 and abstracted the general message engine RocketMQ. Subsequently, RocketMQ was open sourced, and Ali's message middleware officially left the public eye.
In 2015, RocketMQ has experienced the baptism of Double Eleven for many years, and has excellent performance in terms of usability, reliability, and stability. At the same time, cloud computing became popular, and Aliware MQ 1.0 was launched based on RocketMQ, and Aliware MQ 1.0 began to provide messaging services for thousands of companies on Alibaba Cloud.
In 2016, MetaQ carried trillions of messages during Double Eleven, crossing a new milestone. At the same time, RocketMQ entered Apache incubation.insert image description here

1.3 Install via docker

1. The code to pull the image is as follows:

docker pull foxiswho/rocketmq:server
docker pull foxiswho/rocketmq:broker

As shown in the figure: insert image description here
2. The code to create the nameserver container is as follows:

docker create -p 9876:9876 --name rmqserver \
-e "JAVA_OPT_EXT=-server -Xms128m -Xmx128m -Xmn128m" \
-e "JAVA_OPTS=-Duser.home=/opt" -v /mydata/rmq/rmqserver/logs:/opt/logs \
-v /mydata/rmq/rmqserver/store:/opt/store foxiswho/rocketmq:server 

As shown in the figure: insert image description here
3. The code to create the broker container is as follows:

docker create -p 10911:10911 -p 10909:10909 --name rmqbroker \
-e "JAVA_OPTS=-Duser.home=/opt" -e "JAVA_OPT_EXT=-server -Xms128m -Xmx128m -Xmn128m" \
-v /mydata/rmq/rmqbroker/conf/broker.conf:/etc/rocketmq/broker.conf \
-v /mydata/rmq/rmqbroker/logs:/opt/logs \
-v /mydata/rmq/rmqbroker/store:/opt/store foxiswho/rocketmq:broker 

As shown in the figure: insert image description here
4. The code to start the container is as follows:

docker start rmqserver rmqbroker

As shown in the figure: insert image description here
5. The code to set the startup mode is as follows:

sudo docker update rmqserver rmqbroker --restart=always

as the picture shows:insert image description here

1.3.1 Deploying RocketMQ management tools


RocketMQ provides a UI management tool called rocketmq-console, project address: https://github.com/apache/rocketmq-externals/tree/master/rocketmq-console
This tool supports docker and non-docker installation, here we choose Install using docker.
1. The code to pull the image is as follows:

docker pull styletang/rocketmq-console-ng

As shown in the figure: insert image description here
2.#The code to create and start the container is as follows:

docker run -e "JAVA_OPTS=-Drocketmq.namesrv.addr=192.168.56.10:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 8082:8080 -t styletang/rocketmq-console-ng --restart=always

As shown in the figure: insert image description here
access through a browser, http://192.168.56.10:8082/#/. Switch the language to Chinese, and all the functions are clear at a glance.insert image description here

Guess you like

Origin blog.csdn.net/weixin_40055163/article/details/124945243