您好,登錄后才能下訂單哦!
創(chuàng)建Topic
kafka-topics.sh --create --bootstrap-server localhost:9092 --topic abtest --partitions 2 --replication-factor 1
查看Topic都有哪些
kafka-topics.sh --list --zookeeper localhost:2181
生產(chǎn)者,將文件中的數(shù)據(jù)寫(xiě)入Kafka生產(chǎn)者
kafka-console-producer.sh --broker-list localhost:9092 --topic order_topic < abc.txt
消費(fèi)者,從最開(kāi)始的位移,消費(fèi)Topic中的數(shù)據(jù)
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic order_topic --from-beginning
重置Consumer Group的Offset到最新位移
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group group_name_1 --reset-offsets --topic order_topic --to-latest --execute
查看消費(fèi)者組Consumer Group位移
[homework@test ~]$ kafka-consumer-groups.sh --bootstrap-server host1:9092,host2:9092 --describe --group groupname_1
TOPIC PARTITION CURRENT-OFFSET LOG-END-OFFSET LAG CONSUMER-ID HOST CLIENT-ID
order 5 20781271 20781556 285 - - -
order 1 10553765 10554032 267 - - -
order 2 10634508 10634808 300 - - -
order 7 10375128 10375355 227 - - -
order 6 10435147 10435467 320 - - -
order 0 10640342 10640643 301 - - -
order 3 13762141 13762478 337 - - -
order 8 11176468 11176707 239 - - -
order 4 10443088 10443320 232 - - -
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。