kafka常用指令

查看消费组详情:
./bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group test-consumer-group
查看topic详情:
./bin/kafka-topics.sh --topic mytopic --describe --bootstrap-server localhost:9092
创建topic:
bin/kafka-topics.sh --zookeeper localhost:2181 --create --topic mytopic --partitions 10 --replication-factor 3
查看topic详情:
bin/kafka-topics.sh --zookeeper localhost:2181 --desc --topic mytopic 
修改partition数量:
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --partitions 10
删除topic:
server.properties ==> delete.topic.enable=true
bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic mytopic 
创建终端生产者:
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic mytopic 
.\bin\kafka-console-producer.bat --bootstrap-server localhost:9092 --topic my-topic
创建终端消费者:
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic mytopic 
posted @ 2020-07-31 16:22  爆炸峰  阅读(577)  评论(0编辑  收藏  举报
Document