This is Goku’s 166th original article
Architecture Advanced Web Site: www.passjava.cn
Hello, I’m Goku.
The main contents of this article are as follows:
Recently in the reverse RocketMQ message queue, the first thing to do is to put the RocketMQ up right, we are generally Windows or Linux machines, according to the official tutorial at once to run up, in addition to the use of Intel chip Mac can also easily run up.
But when I was running on the Mac M1 machine, I encountered various problems, tossed and turned for a day, and finally got the RocketMQ running on the Mac M1 with Docker, here is a summary of the journey.
Although the demo environment is a Mac M1 system, Linux systems are also suitable
The way to run RocketMQ from source is also described below.
At first I ran with Docker and reported errors, and then I ran with source code, which can run and be able to send and consume messages.
Source address: https://github.com/apache/rocketmq
The version I am using is 4.9.2.
For detailed steps, check out an article Goku wrote earlier:
18 Pictures | This article takes you through setting up the RocketMQ source code debugging environment
A total of three containers are started, and the images used are respectively
Image: rocketmqinc/rocketmq
Image: dyrnq/rocketmq: 4.8.0
Enter the container
Modify the broker.conf file to indicate that the vim tool is not installed, and you need to install the next vim
Then copy this line of commands to the broker.conf file. 192.168.10.197 for its own native IP
If you do not know the address of your IP, you can obtain the native IP address of the mac machine through this command, as follows:
Finally broker.conf is configured as follows:
The original console was rocketmq-console-ng, but it was found that it had been removed on Github. The official tips are as follows:
The above announcement indicates that the previous rocket-console is no longer in this repository, and a separate repository has been created and named RocketMQ Dashboard. Repository path: https://github.com/apache/rocketmq-dashboard
Let’s execute the following command directly:
Note: The IP address here is the native IP
isVIPChannel=false, which must be set here, otherwise you will not be able to get data after opening the console.
Access the container after it starts successfully http://localhost:8080/
Send a message to test_topic
In the message subject, enter Wukong Chat Schema, www.passjava.cn, click the OK button to send the message.
The result is as follows:
Look down at the Message menu bar, select the test_top topic, and you can see a message:
The message content is as follows, and is consistent with the message sent.
You need to modify the broker.conf file inside the container, plus it
brokerIP1=192.168.10.197
And docker needs to increase the command parameter -c when starting the broker: /conf/broker.conf
The IP address here needs to be specified as the Internet address. Because rockerMQ broker selects the intranet address by default.
The parameters of the configuration file are used only if there is a -c parameter in the parameter line. It’s stuck here for a long time.
The source code is as follows:
The problem is that the name server did not start successfully.
– END –
8 years of experience in Internet development, good at microservices, distribution, architecture design. Currently working on infrastructure and performance optimization at a large public company.
InfoQ Contracted Author, Blue Bridge Contracted Author, Alibaba Cloud Expert Blogger, 51CTO Celebrity.
Welcome to add my friends, provide technical answers, resume modification, 500 people technical exchange group.
Goku’s multiple technical topics:
33 SpringCloud Practical Questions, Reply PDF Acquisition.
8 distributed algorithm articles, reply to distributed acquisition.
7 JVM special training, reply to JVM acquisition.
The information necessary for the interview can be obtained by paying attention. ↓↓