Kafka命令

版本:3.6.0

1.kafka-topics.sh

Create, delete, describe, or change a topic

创建、删除、描述或更改主题

查看所有topic
kafka-topics.sh --bootstrap-server centos701:9092,centos702:9092,centos704:9092 --list
描述topic详情
kafka-topics.sh --bootstrap-server centos701:9092,centos702:9092,centos704:9092 --describe --topic first

2.kafka-console-consumer.sh

This tool helps to read data from Kafka topics and outputs it to standard output

该工具读取Kafka主题中的数据,并将其输出到标准输出

消费主题中的数据
kafka-console-consumer.sh --bootstrap-server centos701:9092,centos702:9092,centos704:9092 --topic first
从头开始消费数据
kafka-console-consumer.sh --bootstrap-server centos701:9092,centos702:9092,centos704:9092 --from-beginning --topic first
指定消费者组消费
kafka-console-consumer.sh --bootstrap-server centos701:9092,centos702:9092,centos704:9092 --from-beginning --topic first --group first_group

3.kafka-consumer-groups.sh

查看所有消费者组
kafka-consumer-groups.sh --bootstrap-server centos701:9092,centos702:9092,centos704:9092 --list

运行结果

root@hcss-ecs-6296:/home/kafka/opt/kafka_2.13-3.6.0# ./bin/kafka-consumer-groups.sh --bootstrap-server 127.0.0.1:9092 --list
video_retrieval
service-ai-analysis-access
描述指定消费者组
kafka-consumer-groups.sh --bootstrap-server centos701:9092,centos702:9092,centos704:9092 --describe --group first_group

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值