Rocketmq installation and configuration process


Official website

Official website:

Download the source package:



Server configuration

  1. Configure the JDK environment in the server and upload the compressed package to / usr / local for decompression
tar -zxvf jdk-8u231-linux-x64.tar.gz /usr/local
  1. Configure environment variables
vim /etc/profile

#Insert content
export JAVA_HOME=/usr/local/jdk1.8.0_231
export JRE_HOME=$JAVA_HOME/jre
export PATH=$JAVA_HOME/bin:$PATH

#Immediate effect
source /etc/profile
  1. Enter the rocketmq home directory on windows and compile the project using Maven
mvn -Prelease-all -DskipTests clean install -U

After compilation, find the compressed package in this folder


  1. Upload the compiled compressed package to the Linux system and decompress it
#Create rocketmq directory
mkdir /usr/local/rocketmq

#Unzip the rocketmq package
tar -zxvf rocketmq-distribution-4.3.2.tar.gz -C /usr/local/rocketmq
  1. Run rocketmq
#Enter the / usr / local / rocketmq / bin directory
cd /usr/local/rocketmq/bin

#Modify the startup parameters of the configuration files and
#JAVA_OPT="${JAVA_OPT} -server -Xms1g -Xmx1g -Xmn512m"

#Execute mqnamesrv

#Execute runbroker
./mqbroker -n localhost:9876

Compiling and installing the rocketmq console console


Chinese guide

Upload to the server and unzip

Enter the rocketmq console directory

Execute compilation

mvn clean package -Dmaven.test.skip=true

After successful compilation, execute rocketmq-console-ng-1.0.1.jar in the rocketmq-console / target directory

When starting, add the nameserver address directly or edit to add properties

java -jar rocketmq-console-ng-1.0.1.jar --rocketmq.config.namesrvAddr=

At compile time, the package could not find the prompt 502 error on the mirror

reason:Bad network or Maven warehouse server error

Try again, or change to another image warehouse

Send failure prompt connect to null failed

./ org.apache.rocketmq.example.quickstart.Producer
22:49:02.470 [main] DEBUG i.n.u.i.l.InternalLoggerFactory - Using SLF4J as the default logging framework
RocketMQLog:WARN No appenders could be found for logger (io.netty.util.internal.PlatformDependent0).
RocketMQLog:WARN Please initialize the logger system properly.
java.lang.IllegalStateException: org.apache.rocketmq.remoting.exception.RemotingConnectException: connect to
null failed

reason:hear nothing ofnameserverWhere?

staytoolsAdd to script

export NAMESRV_ADDR=localhost:9876

Cannot allocate memory failed to start broker

reason:JVM startup initialization memory allocation is larger than physical memory

[[email protected] bin]# ./mqbroker -n localhost:9876
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000005c0000000, 8589934592, 0) failed
; error='Cannot allocate memory' (errno=12)#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 8589934592 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /usr/local/rocketmq/bin/hs_err_pid1997.log

Modify the JVM parameters in the startup script broker nameserver

The default values are very large. You can reduce them

JAVA_OPT="${JAVA_OPT} -server -Xms256m -Xmx256m -Xmn128m -XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=100m"

The broker is started successfully, but the prompt: failed to obtain the host name

[[email protected] bin]# ./mqbroker -n localhost:9876
22:30:42.307 [main] ERROR RocketmqCommon - Failed to obtain the host name node-113b: node-113b: No address associated with hostname
	at ~[na:1.8.0_181]
	at org.apache.rocketmq.common.BrokerConfig.localHostName( [rocketmq-common-4.6
.1.jar:4.6.1]	at org.apache.rocketmq.common.BrokerConfig.( [rocketmq-common-4.6.1.jar:4
.6.1]	at [rocketmq
-broker-4.6.1.jar:4.6.1]	at [rocketmq-broker-4.6.1.jar:4
.6.1]Caused by: node-113b: No address associated with hostname
	at Method) ~[na:1.8.0_181]
	at$2.lookupAllHostAddr( ~[na:1.8.0_181]
	at ~[na:1.8.0_181]
	at ~[na:1.8.0_181]
	... 4 common frames omitted
The broker[DEFAULT_BROKER,] boot success. serializeType=JSON and name server is localh

reason:Unable to resolve the current host name

Just add a map to hosts node-113b