Rebalancing is to reallocate subscription relationships between consumers and topic partitions in a consumer group. During rebalancing, all consumers in the consumer group stop consuming messages until rebalancing completes.
Possible causes of rebalancing:
Rebalancing logs record rebalancing details, including the time, reason, and triggering client of rebalancing. This section describes how to view rebalancing logs on the console.
Rebalancing logs are stored and can be queried in Log Tank Service (LTS).
in the upper left corner to select the region where your instance is located.
in the upper left corner and choose Application > Distributed Message Service for Kafka to open the Kafka instance list.
in the upper left corner to select the region where your instance is located.
in the upper left corner and choose Application > Distributed Message Service for Kafka to open the Kafka instance list.To search for logs, see Accessing the Log Search Page.
An example rebalancing log:
{"level":"INFO","timestamp":"2023-03-23 17:23:22,906","message":{"leaderId":"consumer-1-177817b6-1f29-4717-8a83-dda8eaab1635","generationId":"1","reason":"Assignment received from leader for group KMOffsetCache-dms-vm-fa3cf9d6-manager-shared-server-0 for generation 1","groupId":"KMOffsetCache-dms-vm-fa3cf9d6-manager-shared-server-0","coordinatorId":"0","type":"END_REBALANCE","group":"GroupMetadata(groupId=KMOffsetCache-dms-vm-fa3cf9d6-manager-shared-server-0, generation=1, protocolType=Some(consumer), currentState=CompletingRebalance, members=Map(consumer-1-177817b6-1f29-4717-8a83-dda8eaab1635 -> MemberMetadata(memberId=consumer-1-177817b6-1f29-4717-8a83-dda8eaab1635, clientId=consumer-1, clientHost=/172.31.2.168, sessionTimeoutMs=10000, rebalanceTimeoutMs=300000, supportedProtocols=List(range), )))"}}
Table 1 describes the parameters.
Parameter | Description |
|---|---|
level | Level of the rebalancing logs. The only value is INFO. |
timestamp | Time of rebalancing. |
leaderId | Leader consumer ID. |
generationId | Generation ID of the consumer group. Generation is the number of times that a consumer group performs rebalancing. It is incremented by 1 each time a rebalancing is complete. |
reason | Reason for triggering rebalancing. |
groupId | Consumer group ID. |
coordinatorId | Broker where the Coordinator component is. |
type | Operation that triggered rebalancing. Values:
|
group | Information about consumers in the consumer group. |
in the upper left corner to select the region where your instance is located.
in the upper left corner and choose Application > Distributed Message Service for Kafka to open the Kafka instance list.This only disables the rebalancing logging function. The log groups and log streams on LTS are retained and still generate fees. If you no longer need the logs, delete the log groups and log streams.