This is the 9th day of my participation in the August Wen Challenge.More challenges in August

In front of some pre knowledge, knowledge may not be complete, behind the difference and then fill up. This chapter begins the Rocket hands-on.

RocketMQ environment setup

Download RocketMQ

Linux Run Version Download: Run version

Source code download address: Rocket source code

Operating environment: CentOS 7

(PS: RcoketMQ requires JDK installation, please baidu)

After downloading, unpack and configure the RocketMQ environment: my configuration is as follows:

Vim goes into /etc/profile to edit environment variables (profiles are available to all users) : see figure

After editing, source /etc/profile takes effect.

Then RocketMQ is ready to run.

Start the NameServer

Starting NameServer is as simple as executing a script, mqAdminSrv, in the /bin file in the RocketMQ directory.

Note here that RocketMQ’s default JVM is 4 gigabytes of memory, but my virtual machine is only allocated 2 gigabytes, which is definitely not enough. So you need to adjust the memory size of the JVM.

Modify the runserver.sh script in the /bin file:

Before modification:

Revised:

Run the bash mqnamesrv command in the bin directory and print the following log in the nohip. out file to indicate that the command is successfully executed:

PS: nohup may be used on the Internet, but I’m sure this command is not working, I can’t find PID when I want to shut down the running program, I only see a background running command when I use jobs command. So it’s better to be direct.

Java HotSpot(TM) 64-Bit Server VM warning: Using the DefNew young collector with the CMS collector is deprecated and will likely be removed in a future release
Java HotSpot(TM) 64-Bit Server VM warning: UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release.
The Name Server boot success. serializeType=JSON
Copy the code

Start the Broker

The script to start the Broker is runbroker.sh. The default default for the Broker is 8GB of memory, which is obviously not what I need. To adjust the MEMORY of the JVM:

Before the change

Revised:

Next go to the broker.conf file and add a configuration command:

This command represents the automatic creation of a Topic. Only suitable for use in non-production environments. Why is that?

AutoCreateTopicEnable is set to true to enable automatic Topic creation, but the routing information for the newly created Topic is contained on only one of the Broker servers. The principle behind the article to talk about.

Bash mqbroker -n localhost:9876 is executed successfully.

Remember to specify the connection address here, otherwise the following test will not connect to the service

The broker[localhost. Localdomain, 172.17.0.1:10911] Boot Success. SerializeType =JSONCopy the code

PS: A close look at the configuration parameters of broker and NameServer shows that broker uses G1 garbage collector and NameServer uses CMS. Remember the difference between the two? Look back.

Command line authentication

There is a tool in RocketMQ to help us validate the RocketMQ service.

Start by configuring an environment variable NAMESRV_ADDR to point to the NameServer service we started. The address must be the same as when the Broker was started; otherwise, the test cannot connect to the service. NAMESRV_ADDR should be an application-defined variable that reads the IP address from the environment.

export NAMESRV_ADDR='localhost:9876'
Copy the code

Run the following command in the directory:

tools.sh org.apache.rocketmq.example.quickstart.Producer
Copy the code

The following information is displayed:

The last two sentences indicate that the producer closed normally.

Then start the message consumer to receive the message:

tools.sh org.apache.rocketmq.example.quickstart.Consumer
Copy the code

Screen output is as follows:

The entire contents of the log after MessageExt is a complete RocketMQ message. The key attributes are brokerName, Queueld, MSGLD, Topic, Cluster, Tags, Body, TransactionLD.

To stop the service, press Ctrl+C. So are the first two services. At this time, it is my convenience to not execute the script. Ha ha! The closed scripts are these two:

#1. Close the NameServer
sh bin/mqshutdown namesrv
#2. Close the Broker
sh bin/mqshutdown broker
Copy the code

Set up the Rocket cluster environment

Prepare the environment

Prepare three VMS, record the IP addresses of the three VMS, and disable the firewall

My virtual IP

192.168.40.131 DockerVm
192.168.40.132 DockerVm2
192.168.40.133 DockerVm3
Copy the code

Disable the firewall permanently

Systemctl status firewalld.service # Check the firewall status systemctl stop firewalld.service # Disable firewalld.service # Disable the firewallCopy the code

Configure the RocketMQ environment cluster

PS: RocketMQ does not support slave switchover after master failure until version 4.5. After version 4.5, dleger-based master/slave switchover was added. Version 4.7.1 is used here

Set up a cluster in which two disks are flushed asynchronously. So we use the configuration file under conf/ 2M-2s-async. In actual projects, in order to achieve high availability, dleger is generally used. The cluster to be designed is as follows:

The name of the machine The nameServer node is deployed Broker node deployment
dockerVm nameserver
dockerVm2 nameserver broker-a, broker-b-s
dockerVm3 nameserver broker-b,broker-a-s

Modify the 2m-2s-async configuration file in rocketMQ config. Just configure broker.conf.

Rocketmq's recommended configurations can be found in the RocketMQ config directory: 1.2m-2s-Async: 2 Primary and secondary asynchronous flush (high throughput, but message loss); 2.2M-2S-sync: 2 master and 2 slave synchronous disk flushing (higher throughput, but more secure message); 3.2 M-noslave: No master (single point of failure), and you can directly configure broker.conf for single point of environment configuration. 4. Dleger is used to implement master/slave switchover. The nodes in the cluster randomly elect a leader based on Raft protocol, while the rest are followers. This is often the way clusters are built in formal environments;Copy the code

This time, 2M-2s-Async is used to build the cluster.

Configure the first set of broker-A

Configure the master node of Broker-A first in DockerVm2. Configure 2m-2s-async/ broker-a. perties first

The configuration is as follows :(some are newly added, not in the source file)

# Cluster name: all nodes with the same name are in the same cluster
brokerClusterName=rocketmq-cluster
Nodes with the same name are a set of primary and secondary nodes.
brokerName=broker-a
Brokerid,0 for Master, >0 for Slave
brokerId=0
#nameServer address, semicolon split
namesrvAddr=dockerVm:9876; dockerVm2:9876; dockerVm3:9876
# when sending a message, automatically create a topic that does not exist on the server
defaultTopicQueueNums=4
Whether to allow the Broker to create topics automatically
autoCreateTopicEnable=true
Whether to enable the Broker to automatically create subscription groups
autoCreateSubscriptionGroup=true
The port on which the Broker listens for external services
listenPort=10911
The default time for deleting files is 4 a.m
deleteWhen=04
The default retention time is 48 hours
fileReservedTime=120
CommitLog The default file size is 1 gb
mapedFileSizeCommitLog=1073741824
ConsumeQueue By default, each file holds 30W bytes, which can be adjusted according to service conditions
mapedFileSizeConsumeQueue=300000
#destroyMapedFileIntervalForcibly=120000
#redeleteHangedFileInterval=120000
Check physical file disk space
diskMaxUsedSpaceRatio=88
# storage path
storePathRootDir=/app/rocketmq/store
CommitLog storage path
storePathCommitLog=/app/rocketmq/store/commitlog
Consume queue storage path Storage path
storePathConsumeQueue=/app/rocketmq/store/consumequeue
Message index storage path
storePathIndex=/app/rocketmq/store/index
#checkpoint File storage path
storeCheckpoint=/app/rocketmq/store/checkpoint
#abort file storage path
abortFile=/app/rocketmq/store/abort
# limit the message size
maxMessageSize=65536
#flushCommitLogLeastPages=4
#flushConsumeQueueLeastPages=2
#flushCommitLogThoroughInterval=10000
#flushConsumeQueueThoroughInterval=60000
The role of the Broker
# -async_master Asynchronous replication Master
# -sync_master Synchronizes the double write Master
#- SLAVE
brokerRole=ASYNC_MASTER
# Brush plate mode
# -async_flush Asynchronously flush disks
# -sync_flush Synchronously flush disks
flushDiskType=ASYNC_FLUSH
#checkTransactionMessageEnable=false
# Number of sending thread pools
#sendMessageThreadPoolNums=128
# pull message thread pool number
#pullMessageThreadPoolNums=128
Copy the code

The slave node of this node is on dockerVm3. Modified 2m-2s-Async/broker-a-S. perties. Only brokerId and brokerRole need to be modified

# Cluster name: all nodes with the same name are in the same cluster
brokerClusterName=rocketmq-cluster
Nodes with the same name are a set of primary and secondary nodes.
brokerName=broker-a
Brokerid,0 for Master, >0 for Slave
brokerId=1
#nameServer address, semicolon split
namesrvAddr=worker1:9876; worker2:9876; worker3:9876
# when sending a message, automatically create a topic that does not exist on the server
defaultTopicQueueNums=4
Whether to allow the Broker to create topics automatically
autoCreateTopicEnable=true
Whether to enable the Broker to automatically create subscription groups
autoCreateSubscriptionGroup=true
The port on which the Broker listens for external services
listenPort=11011
The default time for deleting files is 4 a.m
deleteWhen=04
The default retention time is 48 hours
fileReservedTime=120
CommitLog The default file size is 1 gb
mapedFileSizeCommitLog=1073741824
ConsumeQueue By default, each file holds 30W bytes, which can be adjusted according to service conditions
mapedFileSizeConsumeQueue=300000
#destroyMapedFileIntervalForcibly=120000
#redeleteHangedFileInterval=120000
Check physical file disk space
diskMaxUsedSpaceRatio=88
# storage path
storePathRootDir=/app/rocketmq/storeSlave
CommitLog storage path
storePathCommitLog=/app/rocketmq/storeSlave/commitlog
Consume queue storage path Storage path
storePathConsumeQueue=/app/rocketmq/storeSlave/consumequeue
Message index storage path
storePathIndex=/app/rocketmq/storeSlave/index
#checkpoint File storage path
storeCheckpoint=/app/rocketmq/storeSlave/checkpoint
#abort file storage path
abortFile=/app/rocketmq/storeSlave/abort
# limit the message size
maxMessageSize=65536
#flushCommitLogLeastPages=4
#flushConsumeQueueLeastPages=2
#flushCommitLogThoroughInterval=10000
#flushConsumeQueueThoroughInterval=60000
The role of the Broker
# -async_master Asynchronous replication Master
# -sync_master Synchronizes the double write Master
#- SLAVE
brokerRole=SLAVE
# Brush plate mode
# -async_flush Asynchronously flush disks
# -sync_flush Synchronously flush disks
flushDiskType=ASYNC_FLUSH
#checkTransactionMessageEnable=false
# Number of sending thread pools
#sendMessageThreadPoolNums=128
# pull message thread pool number
#pullMessageThreadPoolNums=128
Copy the code

Configure the second set of broker-B

The primary node of this set of brokers is on Worker3, so config/2m-2s-async/ broker-b.perties is configured on worker3

# Cluster name: all nodes with the same name are in the same cluster
brokerClusterName=rocketmq-cluster
Nodes with the same name are a set of primary and secondary nodes.
brokerName=broker-b
Brokerid,0 for Master, >0 for Slave
brokerId=0
#nameServer address, semicolon split
namesrvAddr=worker1:9876; worker2:9876; worker3:9876
# when sending a message, automatically create a topic that does not exist on the server
defaultTopicQueueNums=4
Whether to allow the Broker to create topics automatically
autoCreateTopicEnable=true
Whether to enable the Broker to automatically create subscription groups
autoCreateSubscriptionGroup=true
The port on which the Broker listens for external services
listenPort=10911
The default time for deleting files is 4 a.m
deleteWhen=04
The default retention time is 48 hours
fileReservedTime=120
CommitLog The default file size is 1 gb
mapedFileSizeCommitLog=1073741824
ConsumeQueue By default, each file holds 30W bytes, which can be adjusted according to service conditions
mapedFileSizeConsumeQueue=300000
#destroyMapedFileIntervalForcibly=120000
#redeleteHangedFileInterval=120000
Check physical file disk space
diskMaxUsedSpaceRatio=88
# storage path
storePathRootDir=/app/rocketmq/store
CommitLog storage path
storePathCommitLog=/app/rocketmq/store/commitlog
Consume queue storage path Storage path
storePathConsumeQueue=/app/rocketmq/store/consumequeue
Message index storage path
storePathIndex=/app/rocketmq/store/index
#checkpoint File storage path
storeCheckpoint=/app/rocketmq/store/checkpoint
#abort file storage path
abortFile=/app/rocketmq/store/abort
# limit the message size
maxMessageSize=65536
#flushCommitLogLeastPages=4
#flushConsumeQueueLeastPages=2
#flushCommitLogThoroughInterval=10000
#flushConsumeQueueThoroughInterval=60000
The role of the Broker
# -async_master Asynchronous replication Master
# -sync_master Synchronizes the double write Master
#- SLAVE
brokerRole=ASYNC_MASTER
# Brush plate mode
# -async_flush Asynchronously flush disks
# -sync_flush Synchronously flush disks
flushDiskType=ASYNC_FLUSH
#checkTransactionMessageEnable=false
# Number of sending thread pools
#sendMessageThreadPoolNums=128
# pull message thread pool number
#pullMessageThreadPoolNums=128
Copy the code

Then his slave will modify the conf/ 2M-2s-async/broker-b-s.perties on worker2

# Cluster name: all nodes with the same name are in the same cluster
brokerClusterName=rocketmq-cluster
Nodes with the same name are a set of primary and secondary nodes.
brokerName=broker-b
Brokerid,0 for Master, >0 for Slave
brokerId=1
#nameServer address, semicolon split
namesrvAddr=worker1:9876; worker2:9876; worker3:9876
# when sending a message, automatically create a topic that does not exist on the server
defaultTopicQueueNums=4
Whether to allow the Broker to create topics automatically
autoCreateTopicEnable=true
Whether to enable the Broker to automatically create subscription groups
autoCreateSubscriptionGroup=true
The port on which the Broker listens for external services
listenPort=11011
The default time for deleting files is 4 a.m
deleteWhen=04
The default retention time is 48 hours
fileReservedTime=120
CommitLog The default file size is 1 gb
mapedFileSizeCommitLog=1073741824
ConsumeQueue By default, each file holds 30W bytes, which can be adjusted according to service conditions
mapedFileSizeConsumeQueue=300000
#destroyMapedFileIntervalForcibly=120000
#redeleteHangedFileInterval=120000
Check physical file disk space
diskMaxUsedSpaceRatio=88
# storage path
storePathRootDir=/app/rocketmq/storeSlave
CommitLog storage path
storePathCommitLog=/app/rocketmq/storeSlave/commitlog
Consume queue storage path Storage path
storePathConsumeQueue=/app/rocketmq/storeSlave/consumequeue
Message index storage path
storePathIndex=/app/rocketmq/storeSlave/index
#checkpoint File storage path
storeCheckpoint=/app/rocketmq/storeSlave/checkpoint
#abort file storage path
abortFile=/app/rocketmq/storeSlave/abort
# limit the message size
maxMessageSize=65536
#flushCommitLogLeastPages=4
#flushConsumeQueueLeastPages=2
#flushCommitLogThoroughInterval=10000
#flushConsumeQueueThoroughInterval=60000
The role of the Broker
# -async_master Asynchronous replication Master
# -sync_master Synchronizes the double write Master
#- SLAVE
brokerRole=SLAVE
# Brush plate mode
# -async_flush Asynchronously flush disks
# -sync_flush Synchronously flush disks
flushDiskType=ASYNC_FLUSH
#checkTransactionMessageEnable=false
# Number of sending thread pools
#sendMessageThreadPoolNums=128
# pull message thread pool number
#pullMessageThreadPoolNums=128
Copy the code

This completes the configuration. Lock Failed MQ already started Lock Failed MQ already started The listenPort of two instances on the same machine cannot be the same, or the port occupation error will be reported. Nameserver does not need to be configured. Nameserver is stateless.

Start the broker

Note that the memory configuration of the broker and Nameserver is not beyond its own configuration.

1. Start nameServer on the three nodes.

./mqnamesrv dockerVm
./mqnamesrv dockerVm2
./mqnamesrv dockerVm3
Copy the code

The log information about the successful startup is the same as the preceding information.

In starting the broker

The mqBroker directive is used to start the broker, but note that the corresponding configuration file needs to be specified through -c to start the broker.

In the rocketMQ bin file, run the following commands

#Start the master./mqbroker -c .. /conf/2m-2s-async/ broker-a.perties # second node dockerVm2./ mqbroker-c.. /conf/2m-2s-async/ broker-b.perties # dockerVm3
#Start slave again./mqbroker -c .. /conf/2m-2s-async/ broker-b-s.perties # second node./ mqbroker-c.. /conf/2m-2s-async/ broker-a-s.perties #Copy the code

The successful startup of the master and slave nodes prints information similar to that of a single broker. Here is the dockerVm print

Master Master boot: broker-a.properties The broker[broker-a, SerializeType =JSON and name server is dockerVm:9876; dockerVm2:9876; Dockervm3:9876 slave Slave: broker-b-s.properties The broker[broker-b, SerializeType =JSON and name server is 192.168.40.131:9876; 192.168.40.132:9876; 192.168.40.133:9876Copy the code

The test consumer

DockerXX is used to configure the namesrvAddr address in the above configuration file, but I did not configure the mapping between IP and name (PS: also not complete, do not know how to configure), so that the command error:

Run the test command before modifying the configuration file:

#The environment configuration is performed firstexport NAMESRV_ADDR='dockerVm:9876; dockerVm2:9876; DockerVm3:9876 'and then run the command. / tools. Sh org. Apache. Rocketmq. Example. The quickstart. The ProducerCopy the code

The following error message is printed:

The 2021-08-08 17:05:52, 052 ERROR RocketmqCommon - fetch the name server address exception ^ M java.net.UnknownHostException: jmenv.tbsite.net^M at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:196)^M at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:394)^M at java.net.Socket.connect(Socket.java:606)^M at sun.net.NetworkClient.doConnect(NetworkClient.java:175)^M at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)^M at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)^M at sun.net.www.http.HttpClient.<init>(HttpClient.java:242)^M at sun.net.www.http.HttpClient.New(HttpClient.java:339)^M at sun.net.www.http.HttpClient.New(HttpClient.java:357)^M at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1226)^M at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1162)^M at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1056)^M at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:990)^M at org.apache.rocketmq.common.utils.HttpTinyClient.httpGet(HttpTinyClient.java:45)^M at org.apache.rocketmq.common.namesrv.TopAddressing.fetchNSAddr(TopAddressing.java:73)^M at Org.apache.rocketmq.com mon. Namesrv. TopAddressing. FetchNSAddr (TopAddressing. Java: 64) ^ M still has a lot of print information... Space limitation lolCopy the code

Logs should be visible directly in your home folder logs unless specified

Modify the IP in the broker-a. perties file

namesrvAddr=dockerVm:9876; dockerVm2:9876; dockerVm3:9876
# modified to
# nameServer address, separate the delimiter
namesrvAddr=192.168.40.131:9876; 192.168.40.132:9876; 192.168.40.133:9876
Copy the code

The same goes for configuration changes from files. In the configuration environment, run the following command:

#First perform environment configuration (PS: it should be possible to configure it directly in the profile environment, never tried)export NAMESRV_ADDR='dockerVm:9876; dockerVm2:9876; DockerVm3:9876 'and then run the command. / tools. Sh org. Apache. Rocketmq. Example. The quickstart. The ProducerCopy the code

The success message is the same as the single-node test. I won’t repeat it.

And then start the consumer

./tools.sh org.apache.rocketmq.example.quickstart.Consumer
Copy the code

The printed information is the same as that of a single node.

Test the MQadmin administration tool

RocketMQ’s source code does not provide a console like Nacos or RabbitMQ, only an MQadmin command to manage RocketMQ in the bin directory. /mqadmin {command} {args}

All instructions are as follows:

The Topic related to

The name of the meaning Command options instructions
updateTopic Create the update Topic configuration -b Broker address, which indicates the topic Broker. Only one Broker is supported. The address is IP :port
-c Cluster name: indicates the topic cluster. (Clusters can be queried using clusterList.)
-h Print the help
-n NameServer Service address in the format of IP address :port
-p Specify read and write permissions for the new topic (W=2)
-r Number of readable queues (default: 8)
-w Number of writable queues (default 8)
-t Topic name (The name must contain only characters ^[A-za-z0-9_ -]+$
deleteTopic Delete the Topic -c Cluster name: Deletes a topic in a cluster. (Clusters can be queried using clusterList.)
-h Print the help
-n NameServer Service address in the format of IP address :port
-t Topic name (name must use only characters ^[A-za-z0-9_ -]+$)
topicList View the Topic list information -h Print the help
-c If -c is not configured, only the list of topics is returned. If -c is added, the information of clusterName, topic, and consumerGroup is returned
-n NameServer Service address in the format of IP address :port
topicRoute View Topic routing information -t The name of the topic
-h Print the help
-n NameServer Service address in the format of IP address :port
topicStatus View Topic message queue offset -t The name of the topic
-h Print the help
-n NameServer Service address in the format of IP address :port
topicClusterList View the cluster list of topics -t The name of the topic
-h Print the help
-n NameServer Service address in the format of IP address :port
updateTopicPerm Update Topic read and write permissions -t The name of the topic
-h Print the help
-n NameServer Service address in the format of IP address :port
-b Broker address, which indicates the topic Broker. Only one Broker is supported. The address is IP :port
-p Specify read and write permissions for the new topic (W=2)
-c Cluster name: indicates the topic cluster (clusterList can be used to query the cluster). -b is preferred. If there is no -b, run the command on all brokers in the cluster
updateOrderConf Create, delete, and get kv configurations for specific namespaces from NameServer, currently not enabled -h Print the help
-n NameServer Service address in the format of IP address :port
-t The topic, the key
-v OrderConf, value
-m Method, which can be GET, PUT, or delete
allocateMQ Load averaging algorithm is used to calculate the load result of the consumer list load message queue -t The name of the topic
-h Print the help
-n NameServer Service address in the format of IP address :port
-i IpList, separated by commas, calculates these IP addresses to load the message queue for Topic
statsAll Print Topic subscription relationship, TPS, accumulation, 24h read and write total and other information -h Print the help
-n NameServer Service address in the format of IP address :port
-a Whether to print only active topics
-t Specify the topic

The cluster related

The name of the meaning Command options instructions
clusterList View cluster information, cluster, BrokerName, BrokerId, TPS information, etc -m Print more information (add the following information to print #InTotalYest, #OutTotalYest, #InTotalToday,#OutTotalToday)
-h Print the help
-n NameServer Service address in the format of IP address :port
-i Print interval, in seconds
clusterRT Send messages to detect Broker RTS in the cluster. The message is sent to ${BrokerName} Topic. -a Amount, total number of probes per probe, RT = total time/amount
-s Message size, unit B
-c Which cluster to detect
-p Whether to print formatting logs to
-h Print the help
-m Belongs to the machine room, used for printing
-i Send interval, in seconds
-n NameServer Service address in the format of IP address :port

The Broker related

The name of the meaning Command options instructions
updateBrokerConfig Updating the Broker configuration file modifies broker.conf -b Broker address in the format of IP :port
-c The name of the cluster
-k The key value
-v The value value
-h Print the help
-n NameServer Service address in the format of IP address :port
brokerStatus View Broker statistics, running status (almost everything you need) -b Broker address, IP :port
-h Print the help
-n NameServer Service address in the format of IP address :port
brokerConsumeStats Consume Offset, Broker Offset, Diff, TImestamp and other information are returned according to Message Queue dimension -b Broker address, IP :port
-t Request timeout
-l Diff threshold. The value is printed only when the threshold is exceeded
-o Sequential topic, usually false
-h Print the help
-n NameServer Service address in the format of IP address :port
getBrokerConfig Getting Broker configuration -b Broker address, IP :port
-n NameServer Service address in the format of IP address :port
wipeWritePerm Clear Broker write permissions from NameServer -b Broker address, IP :port
-n NameServer Service address in the format of IP address :port
-h Print the help
cleanExpiredCQ Clean up Consume queues that have expired on the Broker, which may result if you manually reduce the number of columns -n NameServer Service address in the format of IP address :port
-h Print the help
-b Broker address, IP :port
-c The name of the cluster
cleanUnusedTopic Clean up the unused topics on the Broker, freeing the Consume Queue of topics from memory, and creating unused topics if you manually delete them -n NameServer Service address in the format of IP address :port
-h Print the help
-b Broker address, IP :port
-c The name of the cluster
sendMsgStatus Send a message to the Broker, returning the send status and RT -n NameServer Service address in the format of IP address :port
-h Print the help
-b BrokerName, note the difference from Broker address
-s Message size, unit B
-c Send the number

News related to

The name of the meaning Command options instructions
queryMsgById Query MSG according to offsetMsgId. If you are using an open source console, use offsetMsgId. This command has other parameters, see QueryMsgByIdSubCommand. -i msgId
-h Print the help
-n NameServer Service address in the format of IP address :port
queryMsgByKey Query messages based on message keys
-t The name of the Topic
-h Print the help
-n NameServer Service address in the format of IP address :port
queryMsgByOffset Query messages based on Offset -b The clusterList contains the name of the Broker, not the address of the Broker.
-i Query queue id
-o Offset value
-t The name of the topic
-h Print the help
-n NameServer Service address in the format of IP address :port
queryMsgByUniqueKey According to the msgId query, msgId is different from offsetMsgId. For details, see Common O&M Problems. -g and -d are used together to try to get a specific consumer to consume the message and return the consumption result -h Print the help
-n NameServer Service address in the format of IP address :port
-i uniqe msg id
-g consumerGroup
-d clientId
-t The name of the topic
checkMsgSendRT Detect RTS that send messages to Topics, which function similar to clusterRT -h Print the help
-n NameServer Service address in the format of IP address :port
-t The name of the topic
-a Number of detection
-s Message size
sendMessage Send a Message, either to a specific Message Queue, depending on the configuration, or simply to send.
-n NameServer Service address in the format of IP address :port
-t The name of the topic
-p Body, message body
-k keys
-c tags
-b BrokerName
-i queueId
consumeMessage Consumer news. You can configure different consumption logic based on offset, start and end timestamps, and message queue consumption messages. See ConsumeMessageCommand for details. -h Print the help
-n NameServer Service address in the format of IP address :port
-t The name of the topic
-b BrokerName
-o Start consumption at offset
-i queueId
-g Consumer group
-s Start time stamp. For details, see -h
-d End time stamp
-c How many messages are consumed
printMsg Consume messages from the Broker and print them for an optional period of time -h Print the help
-n NameServer Service address in the format of IP address :port
-t The name of the topic
-c Character set, such as UTF-8
-s SubExpress, filter expression
-b The start time stamp is in the format of -h
-e End time stamp
-d Whether to print the message body
printMsgByQueue Similar to printMsg, but specifying Message Queue -h Print the help
-n NameServer Service address in the format of IP address :port
-t The name of the topic
-i queueId
-a BrokerName
-c Character set, such as UTF-8
-s SubExpress, filter expression
-b The start time stamp is in the format of -h
-e End time stamp
-p Whether to print a message
-d Whether to print the message body
-f Whether to count the number of tags and print them
resetOffsetByTime Offset is reset by timestamp, both Broker and consumer are reset -h Print the help
-n NameServer Service address in the format of IP address :port
-g Consumer group
-t The name of the topic
-s Reset the offset corresponding to this timestamp
-f Mandatory reset: if false, only backtracking offset is supported. If true, regardless of the relationship between the timestamp offset and consumeOffset
-c Whether to reset c++ client offset

Consumers are related to consumer groups

The name of the meaning Command options instructions
consumerProgress You can view the message accumulation of a specific client IP address by viewing the consumption status of a subscription group -g The name of the group to which the consumer belongs
-s Whether to print the CLIENT IP address
-h Print the help
-n NameServer Service address in the format of IP address :port
consumerStatus View consumer status, including whether all subscriptions in the same group are the same, analyze whether the Process Queue is stacked, and return consumer JStack results. See ConsumerStatusSubCommand -h Print the help
-n NameServer Service address in the format of IP address :port
-g consumer group
-i clientId
-s Whether to execute jStack
getConsumerStatus Get the Consumer consumption progress -g The name of the group to which the consumer belongs
-t Query subject
-i IP address of the Consumer client
-n NameServer Service address in the format of IP address :port
-h Print the help
updateSubGroup Update or create a subscription -n NameServer Service address in the format of IP address :port
-h Print the help
-b The Broker address
-c The name of the cluster
-g Consumer Group Name
-s Whether a group is allowed to consume
-m Whether to consume from the minimum offset
-d Broadcast mode or not
-q Number of retry queues
-r Maximum retry times
-i Effective when slaveReadEnable is enabled and which BrokerId is recommended for slave consumption has not yet been reached. The slave ID can be configured to actively consume slave
-w If the Broker recommends consuming from a slave, the configuration determines which slave to consume from, and configures BrokerId, for example, 1
-a Whether to notify other consumers of load balancing when the number of consumers changes
deleteSubGroup Delete the subscription from the Broker -n NameServer Service address in the format of IP address :port
-h Print the help
-b The Broker address
-c The name of the cluster
-g Consumer Group Name
cloneGroupOffset Use the offset of the source group in the target group -n NameServer Service address in the format of IP address :port
-h Print the help
-s Source consumer group
-d Target consumer group
-t The name of the topic
-o Temporary unused

Connect related

The name of the meaning Command options instructions
consumerConnec tion Query the Consumer’s network connection -g The name of the group to which the consumer belongs
-n NameServer Service address in the format of IP address :port
-h Print the help
producerConnec tion Query the network connection of Producer -g The name of the group to which the producer belongs
-t The topic name
-n NameServer Service address in the format of IP address :port
-h Print the help

NameServer related

The name of the meaning Command options instructions
updateKvConfig Update kv configuration for NameServer, not currently in use -s The namespace
-k key
-v value
-n NameServer Service address in the format of IP address :port
-h Print the help
deleteKvConfig Example Delete the KV configuration of NameServer -s The namespace
-k key
-n NameServer Service address in the format of IP address :port
-h Print the help
getNamesrvConfig Get the NameServer configuration -n NameServer Service address in the format of IP address :port
-h Print the help
updateNamesrvConfig Example Modify the NameServer configuration -n NameServer Service address in the format of IP address :port
-h Print the help
-k key
-v value

other

The name of the meaning Command options instructions
startMonitoring Start the monitoring process to monitor the error deletion of messages and the number of messages in retry queues -n NameServer Service address in the format of IP address :port
-h Print the help