Checking the Consumption Status of Consumer Group
Scenario
View the current consumption information on the client as an MRS cluster administrator based on service requirements.
This section applies to MRS 3.x or later.
Prerequisites
- The MRS cluster administrator has understood service requirements and prepared a system user.
- The Kafka client has been installed.
Procedure
- Log in as a client installation user to the node on which the Kafka client is installed.
- Switch to the Kafka client installation directory, for example, /opt/client.
cd /opt/client
- Run the following command to configure environment variables:
source bigdata_env
- Run the following command to perform user authentication (skip this step in normal mode):
kinit Component service user
- Run the following command to switch to the Kafka client installation directory:
cd Kafka/kafka/bin
- Run the kafka-consumer-groups.sh command to check the current consumption status.
- Check the Consumer Group list on Kafka saved by Offset:
./kafka-consumer-groups.sh --list --bootstrap-server <Service IP address of any node where a broker instances is located:Port number of the Kafka cluster> --command-config ../config/consumer.properties
Example: ./kafka-consumer-groups.sh --bootstrap-server 192.168.1.1:21007 --list --command-config ../config/consumer.properties
- Check the consumption status of Consumer Group on Kafka saved by Offset:
./kafka-consumer-groups.sh --describe --bootstrap-server <Service IP address of any node where a broker instances is located:Port number of the Kafka cluster> --group Consumer group name --command-config ../config/consumer.properties
Example: ./kafka-consumer-groups.sh --describe --bootstrap-server 192.168.1.1:21007 --group example-group --command-config ../config/consumer.properties
- Ensure that the current consumer is online and consumes data.
- Configure the group.id in the consumer.properties configuration file and --group in the command to the group to be queried.
- The Kafka cluster's IP port number is 21007 in security mode and 9092 in normal mode.
- Check the Consumer Group list on Kafka saved by Offset:
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.