bl双性强迫侵犯h_国产在线观看人成激情视频_蜜芽188_被诱拐的少孩全彩啪啪漫画

【kafka】Topic管理

1.查看已經創建的Topic

公司主營業務:成都做網站、網站制作、移動網站開發等業務。幫助企業客戶真正實現互聯網宣傳,提高企業的競爭能力。創新互聯是一支青春激揚、勤奮敬業、活力青春激揚、勤奮敬業、活力澎湃、和諧高效的團隊。公司秉承以“開放、自由、嚴謹、自律”為核心的企業文化,感謝他們對我們的高要求,感謝他們從不同領域給我們帶來的挑戰,讓我們激情的團隊有機會用頭腦與智慧不斷的給客戶帶來驚喜。創新互聯推出柳河免費做網站回饋大家。

cd /usr/local/kafka
./bin/kafka-topics.sh --list --zookeeper 10.1.44.186:2181,10.1.44.187:2181,10.1.44.188:2181
186                    187                    188
------------------     ------------------     ------------------
__consumer_offsets     __consumer_offsets     __consumer_offsets
connect-test           connect-test           connect-test
test0320               test0320               test0320

2.創建topic

cd /usr/local/kafka
./bin/kafka-topics.sh --create --zookeeper 10.1.44.186:2181,10.1.44.187:2181,10.1.44.188:2181 --partitions 3 --replication-factor 2  --topic test0326
# 創建后各broker上的物理目錄
186            187            188
----------     ----------     ----------
test0326-1     test0326-1     test0326-1
test0326-2     test0326-2     test0326-2

3.查看指定topic中Leader的信息

cd /usr/local/kafka
./bin/kafka-topics.sh --describe --zookeeper 10.1.44.186:2181,10.1.44.187:2181,10.1.44.188:2181  --topic test0326
Topic: test0326	PartitionCount:3	ReplicationFactor:2	Configs:
Topic: test0326	Partition: 0	Leader: 0	Replicas: 0,2	Isr: 0,2
Topic: test0326	Partition: 1	Leader: 1	Replicas: 1,0	Isr: 1,0
Topic: test0326	Partition: 2	Leader: 2	Replicas: 2,1	Isr: 2,1

4.查看consumer組內消費的offset

(1) 使用生產者生成一次

(2) 使用test組消費一次

(3) test組當前的消費偏移

offset = 828 , partition=1, key = 4, value = hh老高4

offset = 829 , partition=1, key = 6, value = hh老高6

offset = 1095, partition=0, key = 1, value = hh老高1

offset = 1096, partition=0, key = 5, value = hh老高5

offset = 1097, partition=0, key = 7, value = hh老高7

offset = 1098, partition=0, key = 8, value = hh老高8

offset = 568 , partition=2, key = 0, value = hh老高0

offset = 569 , partition=2, key = 2, value = hh老高2

offset = 570 , partition=2, key = 3, value = hh老高3

offset = 571 , partition=2, key = 9, value = hh老高9

cd /usr/local/kafka
./bin/kafka-run-class.sh kafka.tools.ConsumerOffsetChecker --zookeeper 10.1.44.186:2181,10.1.44.187:2181,10.1.44.188:2181 --group test --topic test0320
# [2018-03-26 11:06:17,939] WARN WARNING: ConsumerOffsetChecker is deprecated and will be dropped in releases following 0.9.0. Use ConsumerGroupCommand instead. (kafka.tools.ConsumerOffsetChecker$)
Group           Topic                          Pid Offset          logSize         Lag             Owner
test            test0320                       0   1099            1099            0               none
test            test0320                       1   830             830             0               none
test            test0320                       2   572             572             0               none

5.kafka-consumer-offset-checker.sh腳本

# bin/kafka-consumer-offset-checker.sh
Option                                  Description                            
------                                  -----------                            
--broker-info                           打印broker信息
--group                                 消費著組
--help                                  幫助信息
--retry.backoff.ms <Integer>            ? Retry back-off to use for failed offset queries. (default: 3000)
--socket.timeout.ms <Integer>           ? Socket timeout to use when querying for offsets. (default: 6000)
--topic                                 以逗號分隔的消費者主題列表(如果不存在的話,所有主題)
--zookeeper                             zookeeper地址

cd /usr/local/kafka
bin/kafka-consumer-offset-checker.sh --zookeeper 10.1.44.186:2181,10.1.44.187:2181,10.1.44.188:2181 --topic test0320 --group test --broker-info
[2018-03-26 11:24:52,014] WARN WARNING: ConsumerOffsetChecker is deprecated and will be dropped in releases following 0.9.0. Use ConsumerGroupCommand instead. (kafka.tools.ConsumerOffsetChecker$)
Group           Topic                          Pid Offset          logSize         Lag             Owner
test            test0320                       0   1115            1115            0               none
test            test0320                       1   838             838             0               none
test            test0320                       2   588             588             0               none
BROKER INFO
2 -> 10.1.44.188:9092
1 -> 10.1.44.187:9092
0 -> 10.1.44.186:9092

當前標題:【kafka】Topic管理
URL地址:http://vcdvsql.cn/article12/jhigdc.html

成都網站建設公司_創新互聯,為您提供關鍵詞優化網站收錄移動網站建設響應式網站App開發網頁設計公司

廣告

聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯

成都定制網站建設