kafka部署

1.启动zookeeper

kafka依赖于zookeeper,需要先启动zookeeper。

进入kafka解压目录后,

linux:

./bin/zookeeper-server-start.sh ./config/zookeeper.properties

windows:

.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties

 

2. 启动kafka

Linux:

./bin/kafka-server-start.sh ./config/server.properties

windows:

.\bin\windows\kafka-server-start.bat .\config\server.properties

 

3.创建主题

Linux:

./bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic topic_name

windows:

.\bin\windows\kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic topic_name

 

4.查看主题列表

Linux:

./bin/kafka-topics.sh --list --zookeeper localhost:2181

windows:

.\bin\windows\kafka-topics.bat --list --zookeeper localhost:2181

 

 

 

 

更完善的参考博客:https://blog.csdn.net/puhanjie/article/details/106498803

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


posted @ 2021-04-20 17:31  yeren2046  阅读(117)  评论(0编辑  收藏  举报