从kafka和zookeeper中获取生产和消费偏移量
-
特殊说明
- 该命令是使用python进行编译,需要使用centos7系统上进行使用。
-
命令详细
[root@mongodb_1 get_offsets_num]# ./get_offsets_num -h
usage: get_offsets_num [-h] [-k KAFKA_HOST] [-z ZOOKEEPER_HOST]
[-m INTERVAL_MINUTES]
Usage of argparse
optional arguments:
-h, --help show this help message and exit
-k KAFKA_HOST, --kafka_host KAFKA_HOST
需要输入kafka:端口
-z ZOOKEEPER_HOST, --zookeeper_host ZOOKEEPER_HOST
需要输入zookeeper:端口
-m INTERVAL_MINUTES, --Interval_minutes INTERVAL_MINUTES
间隔分钟
- 命令执行
[root@mongodb_1 get_offsets_num]# ./get_offsets_num_v2.py -k 10.130.25.77:9092 -z 10.130.25.79:2181
Interval 1 minutes sleep
=======================================================================================
kafka offsets: agent 2574552 2574552
zookeeper offsets: agent 2574552 2574552
agent kafka offsets num: 0 storm offsets num: 0 Actual consumption: 0
=========================&