kafka命令
前言
此处主要记录Windows下的命令,如果想要在linux下使用命令,替换掉.bat成.sh就好(大多数是这样)
注意:以下命令都是已经去到kafka的安装目录下
命令
启动kafka
bin\windows\kafka-server-start.bat config\server.properties
创建topic
.\bin\windows\kafka-topics.bat --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 2 --topic test
–create : 创建命令
–bootstrap-server localhost:9092 指定 IP和对应端口(这里的ip是你架设kafka的位置)
–replication-factor 1 :指定了副本因子(具体是啥笔者还不知道,待我学到再回来补充)
–partitions 2 :指定这一个topic中有多少个partition
查看所有topic
.\bin\windows\kafka-topics.bat --bootstrap-server localhost:9092 --list
–list:用来查看全部topic的命令
查看指定的topic详情
.\bin\windows\kafka-topics.bat --bootstrap-server localhost:9092 --topic <你要查看的topic名字> --describe
kafka命令
http://kxaycabin.cn/2023/03/20/kafka命令/