// 验证是否有对应topic
kafka-topics --bootstrap-server localhost:9092 --list
kafka-topics --bootstrap-server localhost:9092 --list | grep usertag_datafilter_queue
kafka-topics --bootstrap-server localhost:9092 --topic usertag_datafilter_queue --describe
====>
Topic: usertag_datafilter_queue TopicId: bMlI9apET0ur5CW_bE4YsQ PartitionCount: 3 ReplicationFactor: 1 Configs: segment.bytes=1073741824
Topic: usertag_datafilter_queue Partition: 0 Leader: 0 Replicas: 0 Isr: 0 Offline:
Topic: usertag_datafilter_queue Partition: 1 Leader: 0 Replicas: 0 Isr: 0 Offline:
Topic: usertag_datafilter_queue Partition: 2 Leader: 0 Replicas: 0 Isr: 0 Offline:
kafka-topics --bootstrap-server localhost:9092 --topic usertag_datafilter_queue --delete
kafka-topics --alter --bootstrap-server localhost:9092 --topic usertag_datafilter_queue --partitions 3
// 验证topic中是否有数据
kafka-avro-console-consumer --bootstrap-server localhost:9092 --topic usertag_datafilter_queue --from-beginning
kafka-console-consumer --bootstrap-server localhost:9092 --topic usertag_datafilter_queue --from-beginning
## 消费指定分区
kafka-console-consumer --bootstrap-server localhost:9092 --topic usertag_datafilter_queue --from-beginning --partition 0
kafka常用命令
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- 常用命令 启动Zookeeper 可选参数: 启动ZooInspector,可以查看注册到Zookeeper的Ka...
- 本篇结构: kafka topic 管理脚本 kafka 生产者控制台 kafka 消费者控制台 kafka 消费...