Apache RocketMQ 4.2 installation

Apache RocketMQ was donated by Alibaba's original RocketMQ open source to the Apache Foundation, and has now become a top-level project under Apache. The version below RocketMQ 4.0 is the internal release version of RocketMQ that has not yet entered the Apache incubation, and the version after 4.0 is the release version after entering the Apache project. Therefore, the source code package name of RocketMQ's customer service side has changed since 4.0, and the maven dependency has also changed.

Install

Download the binary version of zip and decompress it. When decompressing, you need to specify the directory to decompress it, which is different from decompressing with the tar command. Unzip decompression does not specify the decompression target directory. After decompression, each file directory of the program will be scattered to the current directory. This is the same as decompressing on the window. It needs to be decompressed to the specified folder. Of course, if you use maven to compile and package according to the official document, it will not be The above problem exists. If you don't want to install maven and compile it yourself, you can use the following method.

# unzip -o rocketmq-all-4.2.0-bin-release.zip -d rocketmq
# cd rocketmq

Start Name Server

# nohup sh bin/mqnamesrv &
# tail -f ~/logs/rocketmqlogs/namesrv.log

Start Broker

# nohup sh bin/mqbroker -n localhost:9876 &
# tail -f ~/logs/rocketmqlogs/broker.log

When starting mqbroker, you need to ensure that the host has enough memory. The official default settings of -Xms8g -Xmx8g -Xmn4g are relatively large. If the host memory is not enough, if you only use RocketMQ for installing a virtual machine test, you can runbroker in the bin directory. The jvm startup parameter settings in .sh are smaller.

shut down service

# sh bin/mqshutdown broker
# sh bin/mqshutdown namesrv

connect to <172.17.42.1:10911> failed问题

This ip is the gateway of the virtual network card of docker0, but this ip is not set when starting rocketMQ, so the local ip of ip is specified when starting the Broker. ps: Refer to the official documentation to install on the command line test and there will not be this problem. The problem is mainly when the development environment is connected to the RocketMQ server during development.

# echo "brokerIP1=localhost" > conf/broker.properties
# nohup sh bin/mqbroker -n localhost:9876 -c conf/broker.properties &

Summarize

The purpose of writing this record is not to introduce the installation, because the official documentation has given the installation steps, but some of the problems described above may occur when installing and writing client code tests.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325120166&siteId=291194637