2020-10-20

Mac OS启动Kafka

kafka目录结构

# kafka安装目录/usr/local/Cellar/kafka/2.6.0# 配置文件目录/usr/local/etc/kafka/# 如果超时,在server.properties中增加zookeeper.connection.timeout.ms=6000000

先启动zookeeper

/usr/local/Cellar/kafka/2.6.0/bin/zookeeper-server-start
/usr/local/etc/kafka/zookeeper.properties &

检测是否启动成功
ps aux | grep zookeeper

(上图为启动成功时截图)

后启动kafka

/usr/local/Cellar/kafka/2.6.0/bin/kafka-server-start
/usr/local/etc/kafka/server.properties &

检测是否启动成功
ps aux | grep kakfka

创建topic

kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic basket_test

查看topic list
kafka-topics --list --zookeeper localhost:2181

要是报:Timed out waiting for connection while in state: CONNECTING ,那就是没有启动zk、kafka

创建一个生产者

kafka-console-producer --broker-list localhost:9092 --topic basket_test

进入指定生产者
kafka-console-producer --broker-list localhost:9092 --topic basket_test

创建一个消费者

kafka-console-consumer --bootstrap-server localhost:9092 --topic basket_test --from-beginning

原文转载:http://www.shaoqun.com/a/481385.html

ebay易趣:https://www.ikjzd.com/w/210

1号店网:https://www.ikjzd.com/w/2263

e邮宝:https://www.ikjzd.com/w/594.html?source=tagwish


kafka目录结构#kafka安装目录/usr/local/Cellar/kafka/2.6.0#配置文件目录/usr/local/etc/kafka/#如果超时,在server.properties中增加zookeeper.connection.timeout.ms=6000000先启动zookeeper/usr/local/Cellar/kafka/2.6.0/bin/zookeeper-se
wangwei:https://www.ikjzd.com/w/1744
万国邮政联盟:https://www.ikjzd.com/w/861
冬季国内旅游去漠河怎么样:http://tour.shaoqun.com/a/75549.html
十一旅游推荐 :http://tour.shaoqun.com/a/15231.html
2020年端午节可以去泡温泉吗?:http://tour.shaoqun.com/a/2413.html

No comments:

Post a Comment