简单介绍mac安装kafka,非源码安装,而是使用homebrew进行安装
查看信息
brew info kafka

安装
brew install kafka

启动
kafka-server-start /usr/local/etc/kafka/server.properties &
zookeeper-server-start /usr/local/etc/kafka/zookeeper.properties &
用homebrew也可以启动成功,但是当我执行生产消息的时候没有成功,原因我还没有去深究
创建主题
kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
查看主题
kafka-topics --list --zookeeper localhost:2181
生产消息
kafka-console-producer --broker-list localhost:9092 --topic test

消费消息
kafka-console-consumer --bootstrap-server localhost:9092 --topic test --from-beginning
