使用kafka的bin目录下面的kafka-consumer-groups.sh命令可以查看offset消费情况,注意,如果你的offset是存在kafka集群上的,就指定kafka服务器的地址bootstrap-server:
[root@QA-6-10 bin]# ./kafka-consumer-groups.sh --bootstrap-server 172.17.6.10:9092 --describe --group friend-group
Note: This will only show information about consumers that use the Java consumer API (non-ZooKeeper-based consumers). TOPIC PARTITION CURRENT-OFFSET LOG-END-OFFSET LAG CONSUMER-ID HOST CLIENT-ID
friend 0 13949 13949 0 consumer-1-25efc288-c534-4b1b-a57b-4cfdce853439 /172.17.6.181 consumer-1
friend 1 13871 13871 0 consumer-1-25efc288-c534-4b1b-a57b-4cfdce853439 /172.17.6.181 consumer-1
friend 2 13974 13974 0 consumer-1-25efc288-c534-4b1b-a57b-4cfdce853439 /172.17.6.181 consumer-1
friend 3 14192 14192 0 consumer-1-25efc288-c534-4b1b-a57b-4cfdce853439 /172.17.6.181 consumer-1
friend 4 14036 14036 0 consumer-1-25efc288-c534-4b1b-a57b-4cfdce853439 /172.17.6.181 consumer-1