我需要使用高水印偏移量和消费者偏移量来找到卡夫卡滞后量。我使用了以下公式。
LAG = High Watermark(HW) - Consumer offset(CURRENT-OFFSET)
Kafka命令
E:\kafka_2.11-2.0.0\kafka_2.11-2.0.0\bin\windows>kafka-consumer-groups.bat --bootstrap-server myserverIP:9092 --group usage-consumer-group --describe
我得到如下输出
TOPIC PARTITION CURRENT-OFFSET LOG-END-OFFSET LAG CONSUMER-ID
MyTestTopic_20 1 38361 38361 0 rdkafka-8000786f-d0af-4dca-9387-ade686e2f42f
MyTestTopic_3 1 - 0 - rdkafka-1acb0f8e-2201-4f5d-a3d7-3c65eb046334
MyTestTopic_20 2 37736 37736 0 rdkafka-82613706-fc83-4987-ace4-49f86f4b0ada
MyTestTopic_8 1 - 0 - rdkafka-383f86ff-2643-46f6-9e4d-db38f3397b74
MyTestTopic_14 3 478 478 0 rdkafka-4a71b6aa-0eec-4e0f-a471-a9480554e341
MyTestTopic_100 0 21515 21515 0 rdkafka-0b90588c-d380-4987-a998-bd8d10303359
MyTestTopic_6 3 832560 0 -832560 rdkafka-95836eff-14d1-4f6d-8c25-bbdaf06f778e
MyTestTopic_18 1 261102 261102 0 rdkafka-30f063e7-136b-47c4-ae15-c0016b46f748
MyTestTopic_8 0 1 1 0 rdkafka-0c536163-0202-4751-81b2-e3e8b487f65a
MyTestTopic_7 5 - 0 - rdkafka-bc44b7f6-c221-465a-889b-86dd1a4b996c
MyTestTopic_5 4 - 0 - rdkafka-8c8dd723-368c-4f0f-ae84-bce5b6ce7ba1
MyTestTopic_16 0 359 359 0 rdkafka-1b616e0c-8446-459c-a5df-0edcba32fe87
MyTestTopic_12 4 - 0 - rdkafka-6d697028-0f65-43aa-bb4a-02e765a0c8a5
MyTestTopic_18 2 258853 258853 0 rdkafka-330a0d77-e232-465c-9627-bc984ee3349f
MyTestTopic_6 2 832708 0 -832708 rdkafka-7c6af86b-a181-4456-95e4-0a2dd9510642
MyTestTopic_12 2 - 0 - rdkafka-3344b772-a33e-455b-a4a6-37c5af6f752f
MyTestTopic_8 3 2 2 0 rdkafka-628a389e-774b-4dbe-a93e-4344cff9c633
MyTestTopic_20 3 38472 38472 0 rdkafka-837ed3f3-f4dd-45b8-bd8b-1d89f28722d0
MyTestTopic_9 5 1 1 0 rdkafka-8b7b0122-8e73-492e-9f6c-6481c328c79d
MyTestTopic_8 1 23 0 -23 rdkafka-4070fc97-2000-42d4-a3a1-b07e70477d3a
MyTestTopic_12 2 - 0 - rdkafka-27b54eeb-ed93-4237-9bff-dd2725a614e5
MyTestTopic_20 4 38345 38345 0 rdkafka-9112bc24-3dc0-476e-ac5a-91748f74ef6f
MyTestTopic_5 0 - 0 - rdkafka-266ab95c-58d3-4fa7-8ab2-08d3d6bc9a2f
MyTestTopic_20 0 35892 35892 0 rdkafka-1d284e05-f286-48e1-a9a2-bcc0c9a1850f
MyTestTopic_101 5 21478 21478 0 rdkafka-2e5ab97e-384d-457e-b081-1ac78e73e88f
MyTestTopic_22 2 1 0 -1 rdkafka-7168932d-5406-47c0-aa1f-ce0746c06504
MyTestTopic_17 5 - 0 - rdkafka-a734e13b-9464-4a7f-b744-b7b2b106edc2
MyTestTopic_6 0 833111 0 -833111 rdkafka-2836cd9f-9c17-44b3-a017-a5f03530e226
MyTestTopic_6 4 836101 0 -836101 rdkafka-b91514a6-dad0-4527-9658-38f1d23a322d
MyTestTopic_4 2 - 0 - rdkafka-651a0d55-3029-440f-9f04-d88ffad92314
MyTestTopic_6 5 833608 0 -833608 rdkafka-c00ef8c4-cd17-400c-9f06-e08568487f5f
MyTestTopic_2 1 - 0 - rdkafka-1eb10a97-0258-4150-9cd1-e395c4664590
MyTestTopic_6 1 835996 0 -835996 rdkafka-5c82ebec-d8d2-423e-b8fe-847bbefb3f03
MyTestTopic_16 0 - 0 - rdkafka-431a26a0-086d-41a2-8a63-1e8044d19b91
MyTestTopic_5 1 864 0 -864 rdkafka-2932986f-b8a9-4cd1-813f-0a8f0eb09dff
MyTestTopic_10 4 - 0 - rdkafka-c323a164-6a6d-4132-816f-1ea3361592ca
MyTestTopic_10 3 - 0 - rdkafka-9bddf9a4-d025-4440-afab-96d67de04604
MyTestTopic_22 0 2 0 -2 rdkafka-048cc6e2-0c68-4066-8f7e-06cc1a10b73a
MyTestTopic_20 5 35962 35962 0 rdkafka-e2a01f51-8e7d-43d4-9bc4-faf049b5327e
MyTestTopic_27 1 - 0 - rdkafka-2d352c52-5c76-4b84-8754-8868db0e68d5
MyTestTopic_12 3 - 0 - rdkafka-3cf7f61f-913c-46c9-ab56-40a33391bcde
MyTestTopic_20 2 35687 35687 0 rdkafka-5afa2e8b-3edc-4d47-8c00-3cb6a351d84f
大多数LAG主题是-ve值。为什么会这样?