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
网友评论