kafka 常用命令汇总
生活随笔
收集整理的這篇文章主要介紹了
kafka 常用命令汇总
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
啟動(dòng) kafka 服務(wù)
# 使用 -daemon 選項(xiàng)表示后臺運(yùn)行kafka服務(wù) ./kafka-server-start.sh -daemon ../config/server.properties創(chuàng)建主題
./kafka-topics.sh --create --zookeeper zk_host:port --replication-factor 1 --partitions 1 --topic topic_name列舉所有主題
./kafka-topics.sh --list --zookeeper zk_host:port查看主題明細(xì)
./kafka-topics.sh --describe --zookeeper zk_host:port --topic topic_name列出所有消費(fèi)組
./kafka-consumer-groups.sh --bootstrap-server kafka_host:port --list查看消費(fèi)組中消費(fèi)者的偏移量(offset)
./kafka-consumer-groups.sh --bootstrap-server kafka_host:port --describe --group group_name啟動(dòng)命令行消費(fèi)者
./kafka-console-consumer.sh --zookeeper zk_host:port --topic topic_name --from-beginnin?啟動(dòng)命令行生產(chǎn)者,執(zhí)行下面命令后,每敲一次回車鍵,都會(huì)向指定topic中發(fā)送一條消息,包括空消息
./kafka-console-producer.sh --broker-list localhost:9092,localhost:9093,localhost:9094 --topic test查看分區(qū)中的消息數(shù)量
./kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list localhost:9092,localhost:9093,localhost:9094 --topic test --time -1?
轉(zhuǎn)載于:https://www.cnblogs.com/zy2015/p/7389717.html
總結(jié)
以上是生活随笔為你收集整理的kafka 常用命令汇总的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 文档隐写溯源技术分析
- 下一篇: 000 SpringMVC介绍