kafka-consumer-groups
Learn how to use the kafka-consumer-groups
tool.
The kafka-consumer-groups
tool can be used to list all consumer groups,
describe a consumer group, delete consumer group info, or reset consumer group offsets. The
following topic gives an overview on how to describe or reset consumer group offsets.
Describe Offsets
This tool is primarily used for describing consumer groups and debugging any consumer
offset issues, like consumer lag. The output from the tool shows the log and consumer
offsets for each partition connected to the consumer group that is being described. You can
see at a glance which consumers are current with their partition and which ones are lagging.
From there, you can determine which partitions (and likely the corresponding brokers) are
slow.
Using the tool on secure and unsecure clusters differs slightly. On secure clusters, you
have to use the command-config
option together with an appropriate property
file.
- Describing offsets on an unsecure cluster
-
kafka-consumer-groups --bootstrap-server [HOST]:9092 --describe --group [CONSUMER GROUP]
Use the following command to describe offsets committed to Kafka:
GROUP TOPIC PARTITION CURRENT-OFFSET LOG-END-OFFSET LAG OWNER group1 topic1 0 1 3 2 test-consumer-group_postamac.local-1456198719410-29ccd54f-0
Output Example:
- Describing offsets on a secure cluster
- In order to describe offsets on a secure Kafka cluster, the consumer-groups tool has
to be run with thecommand-config
option. The
command-config
option specifies the property file that contains the
necessary configurations to run the tool on a secure cluster. Which properties are
configured in this file depends on the security configuration of your cluster.