mac安装kafka

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/guohan_solft/article/details/85014990

一、安装

brew install kafka

期间自动安装zookeeper

二、启动zookeeper

zkServer start

三、启动kafka

brew services start kafka

查看进程

guohan:~ guohan$ jps
15840 KafkaUtil
7872 MainApp
15922 QuorumPeerMain
16387 Kafka
16660 Jps

四、创建topic

cd /usr/local/Cellar/kafka/2.1.0
./bin/kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test1

五、消费topic

./bin/kafka-console-consumer --bootstrap-server localhost:9092 --topic test1 --from-beginning

六、生产

./bin/kafka-console-producer --broker-list localhost:9092-topic test1 

猜你喜欢

转载自blog.csdn.net/guohan_solft/article/details/85014990