惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
爱范儿
爱范儿
宝玉的分享
宝玉的分享
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
博客园 - 聂微东
月光博客
月光博客
雷峰网
雷峰网
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
B
Blog RSS Feed
有赞技术团队
有赞技术团队
T
Tailwind CSS Blog
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Check Point Blog
N
Netflix TechBlog - Medium
罗磊的独立博客
博客园 - 司徒正美
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
F
Full Disclosure
Security Archives - TechRepublic
Security Archives - TechRepublic
V
Vulnerabilities – Threatpost
H
Help Net Security
博客园 - 【当耐特】
博客园_首页
Microsoft Security Blog
Microsoft Security Blog
小众软件
小众软件
Hugging Face - Blog
Hugging Face - Blog
L
Lohrmann on Cybersecurity
C
Cybersecurity and Infrastructure Security Agency CISA
P
Privacy International News Feed
Blog — PlanetScale
Blog — PlanetScale
C
CERT Recently Published Vulnerability Notes
P
Privacy & Cybersecurity Law Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Cisco Talos Blog
Cisco Talos Blog
K
Kaspersky official blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Cyberwarzone
Cyberwarzone
S
Schneier on Security
S
SegmentFault 最新的问题
C
Cyber Attacks, Cyber Crime and Cyber Security
S
Securelist

博客园 - 散尽浮华

Rancher 证书到期问题处理手册 Rancher部署并导入K8S集群 K8S集群灾备环境部署 K8S容器环境下GitLab-CI和GItLab Runner 部署记录 K8S持久化存储PV、PVC笔记 K8S部署ES集群 - 运维笔记 容器和镜像转化、迁移方式 - 运维小结 K8S部署RabbitMQ集群 (镜像模式) - 部署笔记 Pod滚动重启方法 - 运维笔记 Node节点禁止调度(平滑维护)方式- cordon,drain,delete K8S中NodePort端口范围修改 Centos7.4升级到Centos7.7 K8S部署Redis Cluster集群(三主三从模式) - 部署笔记 K8S部署Nacos集群 - 部署笔记 K8S部署Kafka界面管理工具(kafkamanager) K8S部署Kafka集群 - 部署笔记 Nginx流量拷贝 - 运维笔记 Nginx基于站点目录和文件的URL访问控制 - 配置笔记 Nginx禁止ip访问或非法域名访问 - 配置笔记
K8S部署RocketMQ集群(双主双从+同步模式) - 部署笔记
散尽浮华 · 2021-02-03 · via 博客园 - 散尽浮华
[root@k8s-master01 ~]# kubectl get pods -n wiseco
NAME                                               READY   STATUS    RESTARTS   AGE
broker-a-0                                         1/1     Running   0          9h
broker-a-s-0                                       1/1     Running   0          9h
broker-b-0                                         1/1     Running   0          9h
broker-b-s-0                                       1/1     Running   0          9h
mq-externals-57c9ddddcb-cffj5                      1/1     Running   0          9h
mq-namesrv-0                                       1/1     Running   0          9h
rocketmq-nfs-client-provisioner-59d8bbd947-k294r   1/1     Running   1          46h

[root@k8s-master01 ~]# kubectl exec -ti broker-a-0 -n wiseco -- /bin/bash
[root@broker-a-0 /]# cd /usr/local/rocketmq-4.8.0/bin/

[root@broker-a-0 bin]# export NAMESRV_ADDR=mq-namesrv-0.mq-namesrv.wiseco.svc.cluster.local:20901
[root@broker-a-0 bin]# echo $NAMESRV_ADDR
mq-namesrv-0.mq-namesrv.wiseco.svc.cluster.local:20901

生产者发送消息
执行命令后,稍微等一下,等到出现下面的输出结果即为正常
[root@broker-a-0 bin]# ./tools.sh org.apache.rocketmq.example.quickstart.Producer
10:00:21.965 [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.
SendResult [sendStatus=SEND_OK, msgId=7F00000148894DC639960C7260600000, offsetMsgId=AC1E55D0000051AF0000000000000000, messageQueue=MessageQueue [topic=TopicTest, brokerName=broker-a, queueId=0], queueOffset=0]
SendResult [sendStatus=SEND_OK, msgId=7F00000148894DC639960C7262B70001, offsetMsgId=AC1E55D0000051AF00000000000000CB, messageQueue=MessageQueue [topic=TopicTest, brokerName=broker-a, queueId=1], queueOffset=0]
SendResult [sendStatus=SEND_OK, msgId=7F00000148894DC639960C7262CE0002, offsetMsgId=AC1E55D0000051AF0000000000000196, messageQueue=MessageQueue [topic=TopicTest, brokerName=broker-a, queueId=2], queueOffset=0]
SendResult [sendStatus=SEND_OK, msgId=7F00000148894DC639960C7262E80003, offsetMsgId=AC1E55D0000051AF0000000000000261, messageQueue=MessageQueue [topic=TopicTest, brokerName=broker-a, queueId=3], queueOffset=0]
SendResult [sendStatus=SEND_OK, msgId=7F00000148894DC639960C7262F60004, offsetMsgId=AC1ED946000051AF0000000000000000, messageQueue=MessageQueue [topic=TopicTest, brokerName=broker-b, queueId=0], queueOffset=0]
................
................

消费者接受消息:
执行命令后,稍微等一下,等到出现下面的输出结果即为正常
[root@broker-a-0 bin]# ./tools.sh org.apache.rocketmq.example.quickstart.Consumer
10:04:02.870 [main] DEBUG i.n.u.i.l.InternalLoggerFactory - Using SLF4J as the default logging framework
Consumer Started.
ConsumeMessageThread_1 Receive New Messages: [MessageExt [brokerName=broker-b, queueId=0, storeSize=203, queueOffset=8, sysFlag=0, bornTimestamp=1612317805388, bornHost=/172.30.85.208:42326, storeTimestamp=1612317805389, storeHost=/172.30.217.70:20911, msgId=AC1ED946000051AF00000000000010B6, commitLogOffset=4278, bodyCRC=1032136437, reconsumeTimes=0, preparedTransactionOffset=0, toString()=Message{topic='TopicTest', flag=0, properties={MIN_OFFSET=0, MAX_OFFSET=20, CONSUME_START_TIME=1612317843435, UNIQ_KEY=7F00000149474DC639960C752B4C0003, CLUSTER=rocketmq-cluster, WAIT=true, TAGS=TagA}, body=[72, 101, 108, 108, 111, 32, 82, 111, 99, 107, 101, 116, 77, 81, 32, 51], transactionId='null'}]]
ConsumeMessageThread_3 Receive New Messages: [MessageExt [brokerName=broker-b, queueId=0, storeSize=204, queueOffset=10, sysFlag=0, bornTimestamp=1612317806220, bornHost=/172.30.85.208:42326, storeTimestamp=1612317806222, storeHost=/172.30.217.70:20911, msgId=AC1ED946000051AF0000000000001712, commitLogOffset=5906, bodyCRC=1918600882, reconsumeTimes=0, preparedTransactionOffset=0, toString()=Message{topic='TopicTest', flag=0, properties={MIN_OFFSET=0, MAX_OFFSET=20, CONSUME_START_TIME=1612317843435, UNIQ_KEY=7F00000149474DC639960C752E8C0013, CLUSTER=rocketmq-cluster, WAIT=true, TAGS=TagA}, body=[72, 101, 108, 108, 111, 32, 82, 111, 99, 107, 101, 116, 77, 81, 32, 49, 57], transactionId='null'}]]
ConsumeMessageThread_2 Receive New Messages: [MessageExt [brokerName=broker-b, queueId=0, storeSize=204, queueOffset=9, sysFlag=0, bornTimestamp=1612317805826, bornHost=/172.30.85.208:42326, storeTimestamp=1612317805828, storeHost=/172.30.217.70:20911, msgId=AC1ED946000051AF00000000000013E2, commitLogOffset=5090, bodyCRC=2088767104, reconsumeTimes=0, preparedTransactionOffset=0, toString()=Message{topic='TopicTest', flag=0, properties={MIN_OFFSET=0, MAX_OFFSET=20, CONSUME_START_TIME=1612317843435, UNIQ_KEY=7F00000149474DC639960C752D02000B, CLUSTER=rocketmq-cluster, WAIT=true, TAGS=TagA}, body=[72, 101, 108, 108, 111, 32, 82, 111, 99, 107, 101, 116, 77, 81, 32, 49, 49], transactionId='null'}]]
ConsumeMessageThread_4 Receive New Messages: [MessageExt [brokerName=broker-b, queueId=0, storeSize=204, queueOffset=11, sysFlag=0, bornTimestamp=1612317806563, bornHost=/172.30.85.208:42326, storeTimestamp=1612317806565, storeHost=/172.30.217.70:20911, msgId=AC1ED946000051AF0000000000001A42, commitLogOffset=6722, bodyCRC=1053751414, reconsumeTimes=0, preparedTransactionOffset=0, toString()=Message{topic='TopicTest', flag=0, properties={MIN_OFFSET=0, MAX_OFFSET=20, CONSUME_START_TIME=1612317843437, UNIQ_KEY=7F00000149474DC639960C752FE3001B, CLUSTER=rocketmq-cluster, WAIT=true, TAGS=TagA}, body=[72, 101, 108, 108, 111, 32, 82, 111, 99, 107, 101, 116, 77, 81, 32, 50, 55], transactionId='null'}]]
................
................

手动测试新增topic
[root@broker-a-0 bin]# sh mqadmin updateTopic -c rocketmq-cluster -n mq-namesrv-0.mq-namesrv.wiseco.svc.cluster.local:20901 -t testtopic
RocketMQLog:WARN No appenders could be found for logger (io.netty.util.internal.PlatformDependent0).
RocketMQLog:WARN Please initialize the logger system properly.
create topic to 172.30.85.208:20911 success.
create topic to 172.30.217.70:20911 success.
TopicConfig [topicName=testtopic, readQueueNums=8, writeQueueNums=8, perm=RW-, topicFilterType=SINGLE_TAG, topicSysFlag=0, order=false]

查看topic列表:
[root@broker-a-0 bin]# sh mqadmin topicList -n mq-namesrv-0.mq-namesrv.wiseco.svc.cluster.local:20901
RocketMQLog:WARN No appenders could be found for logger (io.netty.util.internal.PlatformDependent0).
RocketMQLog:WARN Please initialize the logger system properly.
RMQ_SYS_TRANS_HALF_TOPIC
rocketmq-cluster
%RETRY%please_rename_unique_group_name_4
BenchmarkTest
OFFSET_MOVED_EVENT
TBW102
SELF_TEST_TOPIC
SCHEDULE_TOPIC_XXXX
testtopic
rocketmq-cluster_REPLY_TOPIC
broker-b
TopicTest
broker-a