kafka2.x 基本命令
2020-04-05 本文已影响0人
淼哥1986
export kafka_zk=
export kafka_brokers=
- 创建
kafka-topics --create --zookeeper $kafka_zk --replication-factor 1 --partitions 1 --topic test
- topic列表
kafka-topics --list --zookeeper $kafka_zk
- topic详细
kafka-topics --topic test --describe --zookeeper $kafka_zk
- 生产
kafka-console-producer --broker-list $kafka_brokers --topic test
- 消费
kafka-console-consumer --bootstrap-server $kafka_brokers --topic test --from-beginning
- 消费组列表
kafka-consumer-groups --list --bootstrap-server $kafka_brokers
- 消费组详细
kafka-consumer-groups --describe --group group_id --bootstrap-server $kafka_brokers
- 删除topic
kafka-topics --delete --zookeeper $kafka_zk --topic test