kafka命令

1、创建主题(4个分区,2个副本)

bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 2 --partitions 4 --topic test

2、查询主题

bin/kafka-topics.sh --describe --zookeeper localhost:2181  --topic test

2、修改主题

bin/kafka-topics.sh --alter --zookeeper localhost:2181   --partitions 6 --topic test

4、topic列表查询

bin/kafka-topics.sh --zookeeper 127.0.0.1:2181 --list

topic列表查询(支持0.9版本+)

bin/kafka-topics.sh --list --bootstrap-server localhost:9092

5、新消费者列表查询(支持0.9版本+)

bin/kafka-consumer-groups.sh --new-consumer --bootstrap-server localhost:9092 --list

新消费者列表查询(支持0.10版本+)

bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --list

6、显示某个消费组的消费详情(仅支持offset存储在zookeeper上的)

bin/kafka-run-class.sh kafka.tools.ConsumerOffsetChecker --zookeeper localhost:2181 --group test

显示某个消费组的消费详情(0.9版本 - 0.10.1.0 之前)

bin/kafka-consumer-groups.sh --new-consumer --bootstrap-server localhost:9092 --describe --group test-consumer-group

显示某个消费组的消费详情(0.10.1.0版本+)

bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group my-group

7、分区扩容

bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic topic1 --partitions 2

参考:

https://www.orchome.com/454

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值