kafka分区重建

创建kafka的topic:
./bin/kafka-topics.sh --create --zookeeper 192.168.70.212:2181,192.168.70.213:2181,192.168.70.214:2181 --replication-factor 3 --partitions 3 --topic test01

列举kafka的topic:
./bin/kafka-topics.sh --zookeeper 192.168.70.212:2181,192.168.70.213:2181,192.168.70.214:2181 --list

kafka 修改topic分区数据:
./bin/kafka-topics.sh --zookeeper
192.168.70.212:2181,192.168.70.213:2181,192.168.70.214:2181 -alter --partitions 3 --topic test01

数据均衡:

vi sjzn_spark_binlog_order_topic.json

生成主题分配方案:

./bin/kafka-reassign-partitions.sh --zookeeper
192.168.70.212:2181,192.168.70.213:2181,192.168.70.214:2181 --topics-to-move-json-file sjzn_spark_binlog_order_topic.json --broker-list "0,1,2" --generate Current partition replica assignment

拷贝分配方案到新的json文件中
vi expand-cluster-reassignment.json

执行分配:
./bin/kafka-reassign-partitions.sh --zookeeper
192.168.70.212:2181,192.168.70.213:2181,192.168.70.214:2181 --reassignment-json-file expand-cluster-reassignment.json --execute Current partition replica assignment

查看分区状态:
./bin/kafka-reassign-partitions.sh --zookeeper
192.168.70.212:2181,192.168.70.213:2181,192.168.70.214:2181 --reassignment-json-file expand-cluster-reassignment.json --verify

单独查看topic分区状态:
./bin/kafka-topics.sh --describe --zookeeper 192.168.70.212:2181,192.168.70.213:2181,192.168.70.214:2181 --topic dwd_all_metric

相关推荐
运维行者_2 小时前
网络监控与ITSM集成:从告警到工单,实现运维自动化闭环
开发语言·网络·分布式·后端·架构·flask·php
猿长大人5 小时前
C# | MediatR 入门指南:后端架构解耦
分布式·后端·架构·c#·.net
蓝胖的四次元口袋9 小时前
分布式知识梳理(2)
分布式
小罗水19 小时前
附录D 常见问题排查指南
分布式
2601_960906721 天前
地球或逃逸到相对安全的日心轨道
kafka·hbase·flume·storm
华章酱1 天前
基于 RabbitMQ 与 Hyperf 的消息顺序性保障方案
分布式·rabbitmq
ACP广源盛139246256731 天前
2026 PCIe互连芯片@ACP#国产替代格局解析:芯动科技领跑高端交换芯片赛道
大数据·网络·数据库·人工智能·分布式·嵌入式硬件
creator_Li1 天前
Kafka深入刨析-Consumer
分布式·kafka
国科安芯1 天前
四通道集成降压稳压器在低轨卫星星座分布式供电架构中的应用研究
分布式·架构·电源管理系统·低轨卫星星座·分布式供电·dc-dc降压稳压器·抗辐射加固
土司大王1 天前
黑马点评——分布式锁与 Redis 消息队列
数据库·redis·分布式