Hi,
I’m using Kafka kafka_2.11-1.0.0 and the java client version is 0.10.1.0.
The topic has 9 partitions and there are 2 processes each has 5 consumer 
threads consuming this topic.

The consumer group indefinitely rebalances after the 2 processes started.

This is the consumer config info
------------------------------------------------
        auto.commit.interval.ms = 5000
        auto.offset.reset = latest
        bootstrap.servers = [172.22.9.1:9092, 172.22.9.4:9092, 172.22.9.3:9092]
        check.crcs = true
        client.id = consumer-6835
        connections.max.idle.ms = 540000
        enable.auto.commit = true
        exclude.internal.topics = true
        fetch.max.bytes = 52428800
        fetch.max.wait.ms = 500
        fetch.min.bytes = 1
        group.id = dmkDPGroup
        heartbeat.interval.ms = 3000
        interceptor.classes = null
        key.deserializer = class 
org.apache.kafka.common.serialization.StringDeserializer
        max.partition.fetch.bytes = 1048576
        max.poll.interval.ms = 300000
        max.poll.records = 20
        metadata.max.age.ms = 300000
        metric.reporters = []
        metrics.num.samples = 2
        metrics.sample.window.ms = 30000
        partition.assignment.strategy = [class 
org.apache.kafka.clients.consumer.RangeAssignor]
        receive.buffer.bytes = 65536
        reconnect.backoff.ms = 50
        request.timeout.ms = 305000
        retry.backoff.ms = 100
        sasl.kerberos.kinit.cmd = /usr/bin/kinit
        sasl.kerberos.min.time.before.relogin = 60000
        sasl.kerberos.service.name = null
        sasl.kerberos.ticket.renew.jitter = 0.05
        sasl.kerberos.ticket.renew.window.factor = 0.8
        sasl.mechanism = GSSAPI
        security.protocol = PLAINTEXT
        send.buffer.bytes = 131072
        session.timeout.ms = 10000
        ssl.cipher.suites = null
        ssl.enabled.protocols = [TLSv1.2, TLSv1.1, TLSv1]
        ssl.endpoint.identification.algorithm = null
        ssl.key.password = null
        ssl.keymanager.algorithm = SunX509
        ssl.keystore.location = null
        ssl.keystore.password = null
        ssl.keystore.type = JKS
        ssl.protocol = TLS
        ssl.provider = null
        ssl.secure.random.implementation = null
        ssl.trustmanager.algorithm = PKIX
        ssl.truststore.location = null
        ssl.truststore.password = null
        ssl.truststore.type = JKS
        value.deserializer = class 
org.apache.kafka.common.serialization.StringDeserializer
------------------------------------------------

and this is the log in server(broker)
----------------------------------
[2019-02-28 21:24:54,040] INFO [GroupCoordinator 0]: Stabilized group 
dmkDPGroup generation 54334 (__consumer_offsets-27) 
(kafka.coordinator.group.GroupCoordinator)
[2019-02-28 21:24:54,043] INFO [GroupCoordinator 0]: Assignment received from 
leader for group dmkDPGroup for generation 54334 
(kafka.coordinator.group.GroupCoordinator)
[2019-02-28 21:24:54,192] INFO [GroupCoordinator 0]: Preparing to rebalance 
group dmkDPGroup with old generation 54334 (__consumer_offsets-27) 
(kafka.coordinator.group.GroupCoordinator)

[2019-02-28 21:24:57,150] INFO [GroupCoordinator 0]: Stabilized group 
dmkDPGroup generation 54335 (__consumer_offsets-27) 
(kafka.coordinator.group.GroupCoordinator)
[2019-02-28 21:24:57,151] INFO [GroupCoordinator 0]: Assignment received from 
leader for group dmkDPGroup for generation 54335 
(kafka.coordinator.group.GroupCoordinator)
[2019-02-28 21:24:57,273] INFO [GroupCoordinator 0]: Preparing to rebalance 
group dmkDPGroup with old generation 54335 (__consumer_offsets-27) 
(kafka.coordinator.group.GroupCoordinator)

[2019-02-28 21:25:00,368] INFO [GroupCoordinator 0]: Stabilized group 
dmkDPGroup generation 54336 (__consumer_offsets-27) 
(kafka.coordinator.group.GroupCoordinator)
[2019-02-28 21:25:00,368] INFO [GroupCoordinator 0]: Assignment received from 
leader for group dmkDPGroup for generation 54336 
(kafka.coordinator.group.GroupCoordinator)
[2019-02-28 21:25:00,493] INFO [GroupCoordinator 0]: Preparing to rebalance 
group dmkDPGroup with old generation 54336 (__consumer_offsets-27) 
(kafka.coordinator.group.GroupCoordinator)
----------------------------------
It seems that a rebalance reassignment is received from the consumer group 
leader every 3 seconds.

Is there anyone who has ever met such situation?
And my question is, how can I find out who is the consumer group leader and how 
can I find out why the group coordinator (the coordinator should a broker, is 
it?) thinks there's some consumer has left so it triggers a rebalance?
The GC in consumer is normal (a young GC every several seconds)  and I think it 
does not impact the sending of heartbeat.

I can provide more log info if needed.


Many thanks in advance!















Reply via email to