GeekIt

Kafka命令速查

Topic 管理、生产消费、消费组位点、分区副本、配置配额、压测监控与排障等 132 条命令

共 132 条命令 · 10 类场景 · 点击右侧图标可复制

命令 / 配置说明复制
bin/kafka-topics.sh --version查看 Kafka 客户端工具版本(与 broker 版本可能不同)
bin/kafka-broker-api-versions.sh --bootstrap-server localhost:9092查看 broker 支持的 API 版本,排查客户端兼容性
bin/kafka-cluster.sh cluster-id --bootstrap-server localhost:9092获取集群 ID,迁移与容灾比对时使用
bin/kafka-topics.sh --bootstrap-server localhost:9092 --list列出全部 topic,最常用的第一条命令
bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --describe --all查看所有 broker 的动态配置
bin/kafka-metadata-quorum.sh --bootstrap-server localhost:9092 describe --statusKRaft 模式查看控制器选举与日志状态
bin/kafka-metadata-quorum.sh --bootstrap-server localhost:9092 describe --replication查看控制器的元数据复制情况
bin/kafka-storage.sh random-uuidKRaft 模式生成集群 ID,格式化存储前必须先有它
bin/kafka-storage.sh format -t <cluster-uuid> -c config/kraft/server.properties格式化 KRaft 存储目录(会清空数据,勿对在线节点执行)
bin/kafka-server-start.sh -daemon config/kraft/server.properties后台启动 broker
bin/kafka-server-stop.sh停止 broker(触发受控关闭,尽量不用 kill -9)
bin/kafka-metadata-shell.sh --snapshot logs/__cluster_metadata-0/00000000000000000000.log查看元数据快照内容,排查元数据异常
命令 / 配置说明复制
bin/kafka-topics.sh --bootstrap-server localhost:9092 --create --topic app-logs --partitions 6 --replication-factor 3创建 topic,分区数与副本数是核心参数
bin/kafka-topics.sh --bootstrap-server localhost:9092 --create --topic app-logs --partitions 6 --replication-factor 3 --config retention.ms=604800000创建时指定保留 7 天
bin/kafka-topics.sh --bootstrap-server localhost:9092 --create --topic app-logs --partitions 6 --replication-factor 3 --config max.message.bytes=10485760 --config cleanup.policy=delete指定单条消息上限与清理策略
bin/kafka-topics.sh --bootstrap-server localhost:9092 --describe --topic app-logs查看分区、副本、ISR 与 leader,排查问题的第一现场
bin/kafka-topics.sh --bootstrap-server localhost:9092 --describe查看全部 topic 概要
bin/kafka-topics.sh --bootstrap-server localhost:9092 --describe --topics-with-overrides只看有自定义配置的 topic
bin/kafka-topics.sh --bootstrap-server localhost:9092 --describe --under-replicated-partitions只看副本不足的分区,集群健康关键检查
bin/kafka-topics.sh --bootstrap-server localhost:9092 --describe --unavailable-partitions只看不可用分区(无 leader),直接影响业务读写
bin/kafka-topics.sh --bootstrap-server localhost:9092 --alter --topic app-logs --partitions 12扩容分区(只能增不能减,且会打乱按 key 的顺序)
bin/kafka-configs.sh --bootstrap-server localhost:9092 --alter --entity-type topics --entity-name app-logs --add-config retention.ms=259200000在线修改保留时间为 3 天
bin/kafka-configs.sh --bootstrap-server localhost:9092 --alter --entity-type topics --entity-name app-logs --delete-config retention.ms删除 topic 级覆盖配置,回落到 broker 默认值
bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type topics --entity-name app-logs --describe查看单个 topic 的自定义配置
bin/kafka-topics.sh --bootstrap-server localhost:9092 --delete --topic app-logs删除 topic(需 delete.topic.enable=true,数据不可恢复)
bin/kafka-get-offsets.sh --bootstrap-server localhost:9092 --topic app-logs --time -1查看各分区最大位点(-2 为最早位点)
bin/kafka-log-dirs.sh --bootstrap-server localhost:9092 --describe --topic-list app-logs查看 topic 在各 broker 上的磁盘占用
命令 / 配置说明复制
bin/kafka-console-producer.sh --bootstrap-server localhost:9092 --topic app-logs交互式生产消息,每行一条
bin/kafka-console-producer.sh --bootstrap-server localhost:9092 --topic app-logs --property parse.key=true --property key.separator=:带 key 生产,冒号前为 key
bin/kafka-console-producer.sh --bootstrap-server localhost:9092 --topic app-logs --property parse.headers=true生产带 header 的消息,格式 key:value
bin/kafka-console-producer.sh --bootstrap-server localhost:9092 --topic app-logs --producer-property acks=all指定 acks=all 验证可靠性配置
cat data.json | bin/kafka-console-producer.sh --bootstrap-server localhost:9092 --topic app-logs从文件批量生产消息
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic app-logs消费最新消息(默认从最新位点开始)
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic app-logs --from-beginning从头消费全部历史消息
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic app-logs --group debug-group --from-beginning以指定消费组消费,会影响该组位点
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic app-logs --property print.key=true --property print.partition=true输出 key 与所属分区,排查分区倾斜
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic app-logs --max-messages 10只消费 10 条后退出,适合快速验证
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic app-logs --partition 0 --offset 100指定分区与位点精确读取
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic app-logs --timeout-ms 50005 秒内无消息则退出,适合脚本探测
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic app-logs --consumer.config client.properties使用 SASL/SSL 配置消费
bin/kafka-verifiable-producer.sh --bootstrap-server localhost:9092 --topic app-logs --max-messages 1000生产可校验消息并输出统计,验证链路完整性
命令 / 配置说明复制
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --list列出全部消费组
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group app-group查看各分区 CURRENT-OFFSET、LOG-END-OFFSET 与 LAG
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --all-groups一次查看所有消费组的堆积情况
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group app-group --members --verbose查看组内成员与各自负责的分区
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group app-group --state查看消费组状态(Stable、PreparingRebalance、Empty)
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group app-group --topic app-logs --reset-offsets --to-earliest --execute位点重置到最早(组内必须无活跃消费者)
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group app-group --topic app-logs --reset-offsets --to-latest --execute跳过历史消息只消费新数据
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group app-group --topic app-logs --reset-offsets --to-offset 1000 --execute重置到指定绝对位点
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group app-group --topic app-logs --reset-offsets --shift-by -1000 --execute相对当前位置回退 1000 条,用于重放
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group app-group --topic app-logs --reset-offsets --to-datetime 2026-11-01T00:00:00.000 --execute重置到指定时间点,按时间补数据
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group app-group --topic app-logs --reset-offsets --by-duration PT30M --execute重置到 30 分钟前(ISO-8601 时长格式)
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group app-group --delete-offsets --topic app-logs只删除该 topic 的位点(3.0+)
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --delete --group app-group删除整个消费组(组必须为空)
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group app-group --offsets只输出位点与 lag,便于脚本解析
--dry-run 可先预览位点变化,确认无误再改 --execute重置位点是不可逆操作,务必先演练
命令 / 配置说明复制
bin/kafka-topics.sh --bootstrap-server localhost:9092 --describe --under-replicated-partitions副本数不足的分区,磁盘故障或节点下线时必查
bin/kafka-leader-election.sh --bootstrap-server localhost:9092 --election-type PREFERRED --topic app-logs --partition 0触发优先副本选举,恢复 leader 均衡
bin/kafka-leader-election.sh --bootstrap-server localhost:9092 --election-type PREFERRED --all-topic-partitions为全部分区执行优先副本选举
bin/kafka-leader-election.sh --bootstrap-server localhost:9092 --election-type UNCLEAN --topic app-logs --partition 0非干净选举(可能丢数据),仅当无 ISR 可用时最后手段
bin/kafka-reassign-partitions.sh --bootstrap-server localhost:9092 --topics-to-move-json-file topics.json --broker-list "1,2,3" --generate生成分区迁移方案(topics.json 指定 topic 列表)
bin/kafka-reassign-partitions.sh --bootstrap-server localhost:9092 --reassignment-json-file plan.json --execute --throttle 50000000执行迁移并限速 50MB/s,避免打满带宽
bin/kafka-reassign-partitions.sh --bootstrap-server localhost:9092 --reassignment-json-file plan.json --verify查看迁移进度,必须确认 completed
bin/kafka-reassign-partitions.sh --bootstrap-server localhost:9092 --reassignment-json-file plan.json --cancel取消正在进行的迁移
bin/kafka-preferred-replica-election.sh --bootstrap-server localhost:9092旧版本工具,触发优先副本选举(3.x 已由 leader-election 替代)
bin/kafka-log-dirs.sh --bootstrap-server localhost:9092 --describe查看各 broker 各目录的分区占用,定位磁盘热点
bin/kafka-get-offsets.sh --bootstrap-server localhost:9092 --topic app-logs --time -2查看最早可读位点,评估可回溯窗口
bin/kafka-topics.sh --bootstrap-server localhost:9092 --describe --topic app-logs | grep -c "Isr: 3"统计 ISR 完整的副本数(Linux 环境)
auto.leader.rebalance.enable=true开启自动 leader 均衡(默认 true),避免 leader 长期倾斜
命令 / 配置说明复制
bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-name 1 --describe --all查看单个 broker 的动态配置
bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-name 1 --alter --add-config log.retention.hours=72在线修改 broker 日志保留时长
bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type topics --entity-name app-logs --alter --add-config max.message.bytes=20971520调大单条消息上限(生产端也需同步配置)
bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type topics --entity-name app-logs --alter --add-config min.insync.replicas=2配合 acks=all 保证写入可靠性
bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type topics --entity-name app-logs --alter --add-config cleanup.policy=compact改为压缩策略,保留每个 key 的最新值
bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type clients --entity-name app-producer --describe查看客户端限流配额
bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type clients --entity-name app-producer --alter --add-config producer_byte_rate=10485760,consumer_byte_rate=20971520为客户端设置生产与消费字节速率上限
bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type clients --entity-name app-producer --delete-config producer_byte_rate删除配额限制
bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type users --entity-name app --alter --add-config "SCRAM-SHA-512=[password=密码]"创建或重置 SCRAM 用户密码
bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type ips --entity-name 10.0.0.5 --describe查看按 IP 维度的配额
bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type ip --entity-name 10.0.0.5 --alter --add-config producer_byte_rate=5242880限制异常来源 IP 的写入速率(按 IP 维度须在 broker 开启对应配置)
bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-name 1 --delete-config log.retention.hours删除动态配置回落到静态配置
命令 / 配置说明复制
bin/kafka-producer-perf-test.sh --topic perf-test --num-records 100000 --record-size 1024 --throughput -1 --producer-props bootstrap.servers=localhost:9092 acks=1生产压测:10 万条 1KB 消息,throughput -1 表示不限速
bin/kafka-producer-perf-test.sh --topic perf-test --num-records 50000 --record-size 10240 --throughput 1000 --producer-props bootstrap.servers=localhost:9092限速压测,观察稳定吞吐与延迟分布
bin/kafka-consumer-perf-test.sh --bootstrap-server localhost:9092 --topic perf-test --messages 100000 --group perf-group消费压测,输出吞吐与总耗时
JMX 指标 kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec集群入口消息速率,评估容量与异常流量
JMX 指标 kafka.server:type=ReplicaManager,name=UnderReplicatedPartitions副本不足分区数,持续大于 0 必须告警
JMX 指标 kafka.server:type=KafkaRequestHandlerPool,name=RequestHandlerAvgIdlePercent请求处理线程空闲率,过低说明 broker 处理不过来
JMX 指标 kafka.network:type=RequestMetrics,name=TotalTimeMs,request=Produce生产请求耗时,定位写入慢的环节
JMX 指标 kafka.consumer:type=consumer-fetch-manager-metrics,client-id=*,name=records-lag-max客户端侧消费延迟,业务监控最常看的指标
bin/kafka-run-class.sh kafka.tools.JmxTool --object-name kafka.server:type=BrokerTopicMetrics,name=BytesInPerSec --one-shot true命令行直接读取 JMX 指标,无需额外监控系统
jstat -gcutil <broker-pid> 1000每秒输出 GC 情况,频繁 Full GC 会导致请求抖动
jcmd <broker-pid> GC.heap_info查看堆使用情况,评估内存是否吃紧
num.network.threads=8 与 num.io.threads=16线程数调优:网络线程与 IO 线程按 CPU 核数调整
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --all-groups | awk "{s+=$6} END {print s}"汇总全部消费组总堆积量(按实际输出列调整)
命令 / 配置说明复制
bin/kafka-acls.sh --bootstrap-server localhost:9092 --list列出全部 ACL 规则
bin/kafka-acls.sh --bootstrap-server localhost:9092 --add --allow-principal User:app --operation Read --topic app-logs授予读权限
bin/kafka-acls.sh --bootstrap-server localhost:9092 --add --allow-principal User:app --producer --topic app-logs生产者常用授权组合(Write + Describe)
bin/kafka-acls.sh --bootstrap-server localhost:9092 --add --allow-principal User:app --consumer --topic app-logs --group app-group消费者授权需同时指定 topic 与 group
bin/kafka-acls.sh --bootstrap-server localhost:9092 --add --deny-principal User:guest --operation Write --topic app-logs显式拒绝(deny 优先于 allow)
bin/kafka-acls.sh --bootstrap-server localhost:9092 --remove --allow-principal User:app --operation Read --topic app-logs回收某条授权
bin/kafka-acls.sh --bootstrap-server localhost:9092 --list --topic app-logs只查看某个 topic 上的授权
bin/kafka-acls.sh --bootstrap-server localhost:9092 --list --cluster查看集群级权限(如 Create、Alter)
authorizer.class.name=org.apache.kafka.metadata.authorizer.StandardAuthorizerKRaft 模式启用 ACL 需配置授权器
listeners=SASL_SSL://0.0.0.0:9093 与 sasl.enabled.mechanisms=SCRAM-SHA-512broker 开启 SASL_SSL 认证监听
security.protocol=SASL_SSL 与 ssl.truststore.location=/data/cert/kafka.truststore.jks客户端配置片段,放入 client.properties 后用 --consumer.config 引用
allow.everyone.if.no.acl.found=false默认拒绝未授权访问,ACL 生效后必须设为 false
命令 / 配置说明复制
tail -f logs/server.log实时查看 broker 日志,异常排查入口
grep -iE "ERROR|FATAL" logs/server.log | tail -50提取最近的严重错误
bin/kafka-dump-log.sh --files /data/kafka/app-logs-0/00000000000000000000.log --print-data-log | head -20直接解析日志段文件内容,核对消息是否真的写入
bin/kafka-dump-log.sh --files ... --deep-iteration --print-data-log深度遍历索引,排查索引与数据不一致
bin/kafka-log-dirs.sh --bootstrap-server localhost:9092 --describe | head检查各目录剩余空间,磁盘写满会直接下线 broker
bin/kafka-topics.sh --bootstrap-server localhost:9092 --describe --unavailable-partitions分区不可用(LEADER_NOT_AVAILABLE)时先看这里
NOT_ENOUGH_REPLICAS写入失败:ISR 数量小于 min.insync.replicas,检查副本存活
OFFSET_OUT_OF_RANGE消费位点越界:数据已被清理,需重置位点到 earliest 或 latest
bin/kafka-delete-records.sh --bootstrap-server localhost:9092 --offset-json-file delete.json提前删除指定位点之前的消息(缓解磁盘压力)
bin/kafka-metadata-quorum.sh --bootstrap-server localhost:9092 describe --statusKRaft 集群元数据异常、无法选主时必查
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group app-group --state组状态长期 PreparingRebalance 说明消费者反复进出
df -h /data 与 du -sh /data/kafka/*确认磁盘与各 topic 目录占用,定位增长最快的数据
grep -i "rebalance" logs/server.log | tail -20查看再平衡记录,定位频繁 Rebalance 的组
bin/kafka-broker-api-versions.sh --bootstrap-server localhost:9092 | grep -i "UnsupportedVersion"检查客户端与服务端版本不兼容问题
命令 / 配置说明复制
迁移前先 --generate 生成方案,检查是否跨机架副本分布应避免集中在同一机架,防止整机故障丢副本
broker 下线顺序:先迁移分区 → 确认无 leader → 再停进程直接停机会触发大量 leader 切换与副本同步
controlled.shutdown.enable=true开启受控关闭,停机前自动把 leader 转移出去
bin/kafka-leader-election.sh --bootstrap-server localhost:9092 --election-type PREFERRED --all-topic-partitions下线完成后恢复 leader 均衡
bin/kafka-storage.sh format -t <uuid> -c config/kraft/server.properties --ignore-formatted新节点加入 KRaft 集群时的格式化方式
bin/kafka-metadata-quorum.sh --bootstrap-server localhost:9092 add-controller --command-config admin.propertiesKRaft 扩容 controller 节点
bin/kafka-metadata-quorum.sh --bootstrap-server localhost:9092 remove-controller --controller-id 4 --command-config admin.properties缩容 controller 节点
bin/connect-mirror-maker.sh config/mm2.propertiesMirrorMaker2 跨集群复制,容灾与迁移主力工具
replication.policy.class 与 topics=.* 过滤规则MM2 配置中控制同步哪些 topic 与消费组
bin/kafka-cluster.sh unregister --bootstrap-server localhost:9092 --topic app-logs从集群取消 topic 注册(特殊运维场景)
升级顺序:先滚 broker,再升客户端,最后开新协议版本跨大版本升级要预留回滚窗口并验证兼容性
bin/kafka-features.sh --bootstrap-server localhost:9092 describe查看当前生效的版本与特性开关

运维常用组合

排查消费堆积topic --describe → consumer-groups --describe --group g → 看 LAG 与分区分布
重建消费位点--reset-offsets --to-datetime ... --dry-run → 确认后 --execute
扩容迁移topics-to-move-json-file ... --generate → --execute --throttle → --verify
集群健康巡检describe --under-replicated-partitions → describe --unavailable-partitions → log-dirs --describe
压测验证producer-perf-test 与 consumer-perf-test 观察吞吐与延迟
磁盘治理log-dirs --describe → 调小 retention.ms / retention.bytes → delete-records

常见问题排查

1. 消费者延迟持续增长

先看 LAG 是哪个分区:单分区高说明 key 倾斜或该分区 leader 所在 broker 有压力;整体高则扩消费者或扩分区

2. 副本不足(UnderReplicated)

常见于 broker 下线、磁盘故障或网络抖动;恢复节点后观察 ISR 是否收敛,长期不收敛需迁移副本

3. 位点重置失败

组内存在活跃消费者时不允许重置,先停掉消费者,或用 --dry-run 预览后再 --execute

4. 写入超时 NOT_ENOUGH_REPLICAS

ISR 数少于 min.insync.replicas:恢复副本、降低该值(牺牲可靠性)或改用 acks=1

5. 磁盘快速写满

缩短 retention.ms、开启按大小清理(retention.bytes)、清理无消费组的 topic,必要时 delete-records 提前删除

6. 频繁 Rebalance

会话超时过短或消费处理阻塞导致心跳丢失,调大 session.timeout.ms 与 max.poll.interval.ms

共 132 条 Kafka 命令 · 示例使用 localhost:9092 与 bin/ 目录,请按实际部署路径调整

关于Kafka命令速查

在线 Kafka 命令速查手册,按集群信息与版本、Topic 创建与查询、生产与消费、消费组与位点管理、分区副本与均衡、配置与配额、性能压测与监控指标、安全与 ACL、日志诊断排障、集群运维与迁移等 10 类场景整理 130+ 条常用命令与关键配置,每条附中文说明与可直接复制的写法,支持关键词搜索、分类折叠和一键复制,打开网页即可查阅。涵盖 kafka-topics.sh --list/--create/--describe/--alter/--delete、partitions 与 replication-factor、retention.ms 与 max.message.bytes 与 cleanup.policy、--topics-with-overrides 与 --under-replicated-partitions 与 --unavailable-partitions、kafka-console-producer.sh 的 parse.key/parse.headers/producer-property、kafka-console-consumer.sh 的 --from-beginning/--group/--partition/--offset/--max-messages/--timeout-ms、kafka-consumer-groups.sh --list/--describe 看 LAG 与 CURRENT-OFFSET 与 LOG-END-OFFSET、--reset-offsets 的 to-earliest/to-latest/to-offset/shift-by/by-duration/to-datetime 与 --dry-run/--execute、--delete-offsets、kafka-leader-election.sh PREFERRED 与 UNCLEAN、kafka-reassign-partitions.sh --generate/--execute --throttle/--verify/--cancel、kafka-log-dirs.sh 磁盘占用、kafka-get-offsets.sh 最早与最大位点、kafka-configs.sh 动态配置与客户端配额 producer_byte_rate 与 SCRAM 用户、kafka-producer-perf-test.sh 与 kafka-consumer-perf-test.sh 压测、JMX 指标 MessagesInPerSec 与 UnderReplicatedPartitions 与 records-lag-max、JmxTool 与 jstat 与 jcmd、kafka-acls.sh 授权与 SASL_SSL 配置、kafka-dump-log.sh 与 delete-records 与 metadata-quorum 与 MirrorMaker2 迁移、NOT_ENOUGH_REPLICAS 与 OFFSET_OUT_OF_RANGE 与 LEADER_NOT_AVAILABLE 报错排查。适用于 Kafka 日常运维、消费堆积与 LAG 排查、位点重置与数据重放、分区扩容与副本迁移、磁盘与性能治理、ACL 权限管理与集群迁移,以及运维面试复习。

核心能力

  • 涵盖 kafka-topics.sh --list/--create/--describe/--alter/--delete、partitions 与 replication-factor、retention.ms 与 max.message.bytes 与 cleanup.policy、--topics-with-overrides 与 --under-replicated-partitions 与 --unavailable-partitions、kafka-console-producer.sh 的 parse.key/parse.headers/producer-property、kafka-console-consumer.sh 的 --from-beginning/--group/--partition/--offset/--max-messages/--timeout-ms、kafka-consumer-groups.sh --list/--describe 看 LAG 与 CURRENT-OFFSET 与 LOG-END-OFFSET、--reset-offsets 的 to-earliest/to-latest/to-offset/shift-by/by-duration/to-datetime 与 --dry-run/--execute、--delete-offsets、kafka-leader-election.sh PREFERRED 与 UNCLEAN、kafka-reassign-partitions.sh --generate/--execute --throttle/--verify/--cancel、kafka-log-dirs.sh 磁盘占用、kafka-get-offsets.sh 最早与最大位点、kafka-configs.sh 动态配置与客户端配额 producer_byte_rate 与 SCRAM 用户、kafka-producer-perf-test.sh 与 kafka-consumer-perf-test.sh 压测、JMX 指标 MessagesInPerSec 与 UnderReplicatedPartitions 与 records-lag-max、JmxTool 与 jstat 与 jcmd、kafka-acls.sh 授权与 SASL_SSL 配置、kafka-dump-log.sh 与 delete-records 与 metadata-quorum 与 MirrorMaker2 迁移、NOT_ENOUGH_REPLICAS 与 OFFSET_OUT_OF_RANGE 与 LEADER_NOT_AVAILABLE 报错排查

适用场景

适用于 Kafka 日常运维、消费堆积与 LAG 排查、位点重置与数据重放、分区扩容与副本迁移、磁盘与性能治理、ACL 权限管理与集群迁移,以及运维面试复习。Kafka命令速查全程在浏览器中完成,无需安装插件,可放心用于日常办公与排障。

常见问题

Kafka命令速查是免费的吗?需要注册或安装吗?
Kafka命令速查完全免费,无需注册、无需下载安装任何软件,用浏览器打开网页即可直接使用,也不限制使用次数。
Kafka命令速查支持哪些功能?
涵盖 kafka-topics.sh --list/--create/--describe/--alter/--delete、partitions 与 replication-factor、retention.ms 与 max.message.bytes 与 cleanup.policy、--topics-with-overrides 与 --under-replicated-partitions 与 --unavailable-partitions、kafka-console-producer.sh 的 parse.key/parse.headers/producer-property、kafka-console-consumer.sh 的 --from-beginning/--group/--partition/--offset/--max-messages/--timeout-ms、kafka-consumer-groups.sh --list/--describe 看 LAG 与 CURRENT-OFFSET 与 LOG-END-OFFSET、--reset-offsets 的 to-earliest/to-latest/to-offset/shift-by/by-duration/to-datetime 与 --dry-run/--execute、--delete-offsets、kafka-leader-election.sh PREFERRED 与 UNCLEAN、kafka-reassign-partitions.sh --generate/--execute --throttle/--verify/--cancel、kafka-log-dirs.sh 磁盘占用、kafka-get-offsets.sh 最早与最大位点、kafka-configs.sh 动态配置与客户端配额 producer_byte_rate 与 SCRAM 用户、kafka-producer-perf-test.sh 与 kafka-consumer-perf-test.sh 压测、JMX 指标 MessagesInPerSec 与 UnderReplicatedPartitions 与 records-lag-max、JmxTool 与 jstat 与 jcmd、kafka-acls.sh 授权与 SASL_SSL 配置、kafka-dump-log.sh 与 delete-records 与 metadata-quorum 与 MirrorMaker2 迁移、NOT_ENOUGH_REPLICAS 与 OFFSET_OUT_OF_RANGE 与 LEADER_NOT_AVAILABLE 报错排查。
Kafka命令速查适合哪些场景使用?
适用于 Kafka 日常运维、消费堆积与 LAG 排查、位点重置与数据重放、分区扩容与副本迁移、磁盘与性能治理、ACL 权限管理与集群迁移,以及运维面试复习。