kafka-常用命令整理

2020-08-29  本文已影响0人  偏执的感叹号

一、启动

nohup  sh bin/kafka-server-start.sh config/server.properties &
sh sh bin/kafka-server-start.sh -daemon config/server.properties

二、topic 创建

sh bing/kafka-topics.sh

--zookeeper  # zk的ip地址列表

--create  #创建命令

--topic #后跟topic名

--partitions #分区数

--replication-factor # 副本数

sh bin/kafka-topics.sh --create --topic test1 --zookeeper localhost:2181 --partitions 5 --replication-factor 1
sh bin/kafka-topics.sh --list --zookeeper localhost:2181
sh bin/kafka-topics.sh --describe --zookeeper localhost:2181  --topic test1
sh bin/kafka-configs.sh --zookeeper localhost:2181 --describe --entity-name test1 --entity-type topics

三、topic 生产数据

Todo

上一篇 下一篇

猜你喜欢

热点阅读