Kafka 常用命令行詳細(xì)介紹及整理
更新時(shí)間:2016年12月13日 15:57:31 投稿:lqh
這篇文章主要介紹了 Kafka 常用命令行詳細(xì)介紹及整理的相關(guān)資料,需要的朋友可以參考下
Kafka 常用命令行詳細(xì)介紹及整理
以下是kafka常用命令行總結(jié):
1.查看topic的詳細(xì)信息 ./kafka-topics.sh -zookeeper 127.0.0.1:2181 -describe -topic testKJ1 2、為topic增加副本 ./kafka-reassign-partitions.sh -zookeeper 127.0.0.1:2181 -reassignment-json-file json/partitions-to-move.json -execute 3、創(chuàng)建topic ./kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic testKJ1 4、為topic增加partition ./bin/kafka-topics.sh –zookeeper 127.0.0.1:2181 –alter –partitions 20 –topic testKJ1 5、kafka生產(chǎn)者客戶端命令 ./kafka-console-producer.sh --broker-list localhost:9092 --topic testKJ1 6、kafka消費(fèi)者客戶端命令 ./kafka-console-consumer.sh -zookeeper localhost:2181 --from-beginning --topic testKJ1 7、kafka服務(wù)啟動(dòng) ./kafka-server-start.sh -daemon ../config/server.properties 8、下線broker ./kafka-run-class.sh kafka.admin.ShutdownBroker --zookeeper 127.0.0.1:2181 --broker #brokerId# --num.retries 3 --retry.interval.ms 60 shutdown broker 9、刪除topic ./kafka-run-class.sh kafka.admin.DeleteTopicCommand --topic testKJ1 --zookeeper 127.0.0.1:2181 ./kafka-topics.sh --zookeeper localhost:2181 --delete --topic testKJ1 10、查看consumer組內(nèi)消費(fèi)的offset ./kafka-run-class.sh kafka.tools.ConsumerOffsetChecker --zookeeper localhost:2181 --group test --topic testKJ1
感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!
您可能感興趣的文章:
- kafka調(diào)試中遇到Connection to node -1 could not be established. Broker may not be available.
- Docker + Nodejs + Kafka + Redis + MySQL搭建簡(jiǎn)單秒殺環(huán)境
- docker部署kafka的方法步驟
- Kafka利用Java實(shí)現(xiàn)數(shù)據(jù)的生產(chǎn)和消費(fèi)實(shí)例教程
- kafka監(jiān)控獲取指定topic的消息總量示例
- Java使用kafka發(fā)送和生產(chǎn)消息的示例
- 詳解使用docker搭建kafka環(huán)境
- node連接kafka2.0實(shí)現(xiàn)方法示例
相關(guān)文章
Centos7實(shí)現(xiàn)磁盤限額設(shè)置方法
本篇文章給大家詳細(xì)分享了Centos7實(shí)現(xiàn)磁盤限額設(shè)置方法,對(duì)此有需要的朋友可以參考學(xué)習(xí)下。2018-02-02
vmware10.0破解版安裝centos的詳細(xì)步驟
這篇文章主要為大家詳細(xì)介紹了vmware10.0破解版安裝centos的詳細(xì)步驟,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-10-10
Linux中如何修改~/.bashrc或/etc/profile設(shè)置環(huán)境變量
這篇文章主要介紹了Linux中如何修改~/.bashrc或/etc/profile設(shè)置環(huán)境變量問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-05-05

