赞
踩
Windows 监控
jconsole 查看kafka.consumer---->consumer-fetch-manager-metrics--->attributes
records-lag-max:71456
records-lead-min:54
监控到Lag 越来越大,说明消费者程序边的越来越慢,至少追不上生产者的速度
监控Lead 越来越小,甚至接近0 ,这预示着消费端要丢数据(因为只保存七天的数据,说明消息已经接近7天未被消费了)
Linux 监控
kafka-consumer-groups.sh --bootstrap-server node1:9092 --describe --group mylcy
可以看到当前的消费进度(CURRENT-OFFSET)、消息进度(LOG-END-OFFSET)【有多少数据】、落后量(LAG)
- ./kafka-consumer-groups.sh --bootstrap-server 10.20.73.191:9092 --describe --group kafka-test-group
-
- GROUP TOPIC PARTITION CURRENT-OFFSET LOG-END-OFFSET LAG CONSUMER-ID HOST CLIENT-ID
- kafka-test-group demo_kafka_2 0 0 0 0 consumer-kafka-test-group-1-9de6fbde-2718-4db1-80d9-93db67113f9d /10.20.73.191 consumer-kafka-test-group-1
- kafka-test-group SXMData 0 20000 0 -20000 consumer-kafka-test-group-2-e0410f7d-7d4a-4ee0-a4c6-d39905f296bd /10.20.73.191 consumer-kafka-test-group-2
- kafka-test-group SXMData_2 0 20 20 0 consumer-kafka-test-group-2-77d9d098-71da-419b-9ebc-02e0346e5689 /10.20.17.160 consumer-kafka-test-group-2
往kafka中塞值:
kafka-console-producer.sh --bootstrap-list localhost:9092 --topic MBWSdata
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。