brew install zookeeper
安装后路径:/usr/local/Cellar/zookeeper
配置文件路径:/usr/local/etc/zookeeper
brew services start zookeeper
brew install kafka
安装后路径:/usr/local/Cellar/kafka
配置文件目录:/usr/local/etc/kafka
brew services start kafka
kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic tw-workshop
kafka-topics --list --zookeeper localhost:2181
生产
kafka-console-producer.sh --broker-list localhost:9092 --topic tw-workshop
消费
kafka-console-consumer --bootstrap-server localhost:9092 --topic tw-workshop