1、查看topic列表:kafka-topics -zookeeper localhost --list
2、查看实时的数据 : kafka-console-consumer --topic topic名 --zookeeper localhost 查看实时的数据
后面加 --from-beginning 历史数据
3、生产消息:/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic topicname
4、消费消息:/bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic topicname --from-beginning
5、启动kafka:/bin/kafka-server-start.sh config/server.properties
6、创建topic:/bin/kafka-topics.sh --create --topic topicname --replication-factor 2 --partitions 3 --zookeeper localhost:2181
7、查看topic详细信息:/bin/kafka-topics.sh --describe --topic topicname --zookeeper localhost:2181
757

被折叠的 条评论
为什么被折叠?



