本文未完成,有空再补充,不小心发布了,抱歉
Rocket版本:4.3.0
这几天在整RocketMQ,可谓是困难重重,其中关于控制台的命令,网上的都是一半一半的,
所以我打算直接用整一个完整的官方的命令的翻译以及使用详解。
其中很多命令我都没用过,反正我尽量将我用过的,知道的命令加以解释吧。
其他没用过的就原文代替,所以本文会随着我的使用而更新。
题外话:关于broker.conf的问题
初始的broker.conf文件一开始只有开头注释和几个配置项,其他配置项并没有在文件里显示,而且我在里面改了deleteWhen这个配置项的时候。
发现并没有生效,也是奇怪。
然后当我偶然用了控制台命令 updateBrokerConf 修改deleteWhen的时候,再去打开broker.conf文件,发现文件内容变成了全部的配置项,那个
开头的注释都不见了,这奇怪吧,如果有哪位仁兄知道的并且想告诉我怎么回事的话,欢迎私信。
命令我就参考网上他们的表格形式吧,好看一点,或者说如果网上只写了10个命令,那我就把剩下的都补上,所以相当于完善,不存在什么抄不抄袭。
原版命令
The most commonly used mqadmin commands are:
updateTopic Update or create topic
deleteTopic Delete topic from broker and NameServer.
updateSubGroup Update or create subscription group
deleteSubGroup Delete subscription group from broker.
updateBrokerConfig Update broker‘s config
updateTopicPerm Update topic perm
topicRoute Examine topic route info
topicStatus Examine topic Status info
topicClusterList get cluster info for topic
brokerStatus Fetch broker runtime status data
queryMsgById Query Message by Id
queryMsgByKey Query Message by Key
queryMsgByUniqueKey Query Message by Unique key
queryMsgByOffset Query Message by offset
queryMsgByUniqueKey Query Message by Unique key
printMsg Print Message Detail
printMsgByQueue Print Message Detail
sendMsgStatus send msg to broker.
brokerConsumeStats Fetch broker consume stats data
producerConnection Query producer‘s socket connection and client version
consumerConnection Query consumer‘s socket connection, client version and subscription
consumerProgress Query consumers‘s progress, speed
consumerStatus Query consumer‘s internal data structure
cloneGroupOffset clone offset from other group.
clusterList List all of clusters
topicList Fetch all topic list from name server
updateKvConfig Create or update KV config.
deleteKvConfig Delete KV config.
wipeWritePerm Wipe write perm of broker in all name server
resetOffsetByTime Reset consumer offset by timestamp(without client restart).
updateOrderConf Create or update or delete order conf
cleanExpiredCQ Clean expired ConsumeQueue on broker.
cleanUnusedTopic Clean unused topic on broker.
startMonitoring Start Monitoring
statsAll Topic and Consumer tps stats
allocateMQ Allocate MQ
checkMsgSendRT check message send response time
clusterRT List All clusters Message Send RT
getNamesrvConfig Get configs of name server.
updateNamesrvConfig Update configs of name server.
getBrokerConfig Get broker config by cluster or special broker!
queryCq Query cq command.
sendMessage Send a message
consumeMessage Consume message
我靠,44个命令,怪不得网上资料只整了十几个,这有点多啊哈哈,不过,我来做第一个完善的人也不错(不知道是不是第一个)。
那就按着原版命令的顺序来整理吧。其中默认值什么的是看源码里面的,所以版本是4.3.0的。仅供参考。
命令的参数也是按着命令的帮助显示来弄的,其实我就是翻译一下,顺便把用过的给说一下。翻译水准不太行,仅供参考。
其中有一些说明,那就是 -b 参数就是broker,-c 参数就是cluster(集群) ,-n 参数就是nameServer,
它们虽然是可选参数,但其实还是需要填的,因为起码你执行命令要知道是在哪里执行吧。具体看是否必填的说明。
1.updateTopic 更新或创建topic
参数 | 参数原文 | 是否必填 | 默认值 | 说明 |
b | brokerAddr | 如果-c为空,则必填 | broker 地址,表示topic 建在该broker | |
c | clusterName | 如果-b为空,则必填 | cluster 名称,表示topic 建在该cluster | |
h | help | 否 | 命令帮助 | |
n | namesrvAddr | 是 |
nameServer地址列表, 例如:192.168.0.1:9876;192.168.0.2:9876 |
|
o | order | 否 | false |
设置topic的顺序(真|假 ) 顺序什么的,我还没接触过 |
p | perm | 否 | 6 |
设置topic的权限(2 | 4 | 6),介绍[2:W 4:R; 6:RW] 权限什么的,我也没用过 |
r | readQueueNums | 否 | 8 | 设置读队列的数量 |
s | hasUnitSub | 否 |
原文是has unit sub (true|false sub是订阅组的意思,unit sub 我就不知道了 |
|
t | topic | 是 | topic名字 | |
u | unit | 否 | false |
原文是is unit topic (true|false unit是什么概念啊,我好像没有看到 |
w | writeQueueNums | 否 | 8 | 设置写队列的数量 |
示例: bin/mqadmin updateTopic -b 192.168.10.1:10911 -n 192.168.10.1:9876 -t firstTopic
2.deleteTopic 从broker和NameServer中删除topic
参数 | 参数原文 | 是否必填 | 默认值 | 说明 |
c | clusterName | 是 | cluster 名称,表示从哪个cluster中删除该topic | |
h | help | 否 | 命令帮助 | |
n | namesrvAddr | 是 |
nameServer地址列表, 例如:192.168.0.1:9876;192.168.0.2:9876 |
|
t | topic | 是 | topic名字 |
原文:https://www.cnblogs.com/yellowgg/p/11712638.html