Kafka常用命令

kafka默认端口:9092,zk默认端口:2181

启动zk:./bin/zookeeper-server-start.sh -daemon config/zookeeper.properties

启动kafka:./bin/kafka-server-start.sh config/server.properties &

启动成功:

创建topic:./bin/kafka-topics.sh --create --zookeeper localhost:2181  --replication-factor 1 --partitions 1 --topic hello_world

查看topic列表:./bin/kafka-topics.sh --list --zookeeper localhost:2181

生产者生产消息:./bin/kafka-console-producer.sh --broker-list localhost:9092 --topic hello_world

原文地址:https://www.cnblogs.com/cing/p/13356323.html