kafka常用命令

2021-08-14 10:57:12 字數 1097 閱讀 8711

啟動集群

nohup bin/kafka-server-start.sh config/server.properties &
建立topic

kafka

-topics--

topictt-

-replication

-factor3-

-partitions3-

-create--

zookeeper

hadoop1:2181

列舉topic

kafka

-topics--

list--

zookeeper

hadoop1:2181

生產資料

kafka-console

-producer

--broker-list hadoop1:9092,hadoop2:9092

--topic tt

消費資料

kafka

-console

-consumer--

zookeeper10.

45.55.

121:2181,10

.45.54

.114:2181,10

.47.72

.76:2181--

topic

test3--

from

-beginning

刪除topic

(1)登入zookeeper客戶端:命令:zookeeper-client

(2)找到topic所在的目錄:ls /brokers/topics

(3)找到要刪除的topic,執行命令:rmr /brokers/topics/【topic name】即可,此時topic被徹底刪除。

kafka常用命令

kafka常用操作命令 l檢視當前伺服器中的所有topic bin kafka topics.sh list zookeeper hadoop02 2181 l建立topic kafka topics.sh create zookeeper hadoop02 2181 replication fac...

Kafka 常用命令

kafka console producer broker list 127.0.0.1 9092 topic mytopic kafka console consumer bootstrap server 127.0.0.1 9092 topic mytopic 建立主題,replication ...

kafka常用命令

啟動kafka bin kafka server start.sh daemon opt kafka config server.properties 關閉kafka kill 9 程序號 kafka建立topic bin kafka topics.sh create zookeeper 12.13...