美文网首页
Kakfa常用命令

Kakfa常用命令

作者: 2fc2a81494ac | 来源:发表于2017-05-25 10:12 被阅读0次

创建主题

4个分区,2个副本
kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 2 --partition 4 --topic test

查询集群描述

kafka-topics.sh --describe --zookeeper

生产者

kafak-console-producer.sh --broker-list localhost:9092 --topic test

生产者新 0.9+版本

kafka-console-producer.sh --broker-list localhost:9092 --topic test --producer.config config/produer.properties

消费者

kafka-console-consumer.sh --zookeeper localhost:2181 --topic test

新消费者 0.9+版本

kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --new-consumer --from-beginning --consumer.config config/consumer.properties

相关文章

网友评论

      本文标题:Kakfa常用命令

      本文链接:https://www.haomeiwen.com/subject/rivaxxtx.html