下载
解压
启动
启动kafka前需要先启动zookeeper,这里使用默认配置,直接启动Kafka自带的zookeeper
cd 到Kafka目录
启动内置的zookeeper:./bin/zookeeper-server-start.sh ./config/zookeeper.properties &
启动Kafka: ./bin/kafka-server-start.sh ./config/server.properties &
创建topic:.bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test
列出topic : bin/kafka-topics.sh --list --bootstrap-server localhost:9092
生产数据:.bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
标签:bin,单机版,--,zookeeper,server,Mac,sh,kafka From: https://www.cnblogs.com/dch-21/p/16993852.html消费数据: .bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning