Support Questions

Find answers, ask questions, and share your expertise

NiFi: ConsumeKafka fails to retrieve from Kafka

avatar
Expert Contributor

Hi,

NiFi has not been able to retrieve the messages from Kafka, within few secs after the start it throws the below error. The below log detail doesn't provide adequate detail to troubleshoot. Could you please shed some light on tracing the below issue?

  • Kafka version : 0.9.0.2.4.2.0-258
  • HDF Version: 2.0.1

NiFi log:

22:44:40 EST DEBUG b24213d2-1008-1158-cec5-cd8961a6f7bc

ConsumeKafka[id=b24213d2-1008-1158-cec5-cd8961a6f7bc] Rebalance Alert: Paritions '[]' revoked for lease 'org.apache.nifi.processors.kafka.pubsub.ConsumerPool$SimpleConsumerLease@6f4d8702' with consumer 'org.apache.kafka.clients.consumer.KafkaConsumer@31c1244d'

22:44:40 EST DEBUG b24213d2-1008-1158-cec5-cd8961a6f7bc

ConsumeKafka[id=b24213d2-1008-1158-cec5-cd8961a6f7bc] Rebalance Alert: Paritions '[olem-0, olem-1]' assigned for lease 'org.apache.nifi.processors.kafka.pubsub.ConsumerPool$SimpleConsumerLease@6f4d8702' with consumer 'org.apache.kafka.clients.consumer.KafkaConsumer@31c1244d'

Kafka - server log:

[2016-11-14 22:44:40,707] INFO [GroupCoordinator 1001]: Preparing to restabilize group olem_group with old generation 0 (kafka.coordinator.GroupCoordinator)

[2016-11-14 22:44:40,708] INFO [GroupCoordinator 1001]: Stabilized group olem_group generation 1 (kafka.coordinator.GroupCoordinator)

[2016-11-14 22:44:40,709] INFO [GroupCoordinator 1001]: Assignment received from leader for group olem_group for generation 1 (kafka.coordinator.GroupCoordinator)

[2016-11-14 22:45:10,711] INFO [GroupCoordinator 1001]: Preparing to restabilize group olem_group with old generation 1 (kafka.coordinator.GroupCoordinator)

[2016-11-14 22:45:10,711] INFO [GroupCoordinator 1001]: Group olem_group generation 1 is dead and removed (kafka.coordinator.GroupCoordinator)

[2016-11-14 22:47:17,332] INFO [Group Metadata Manager on Broker 1001]: Removed 0 expired offsets in 0 milliseconds. (kafka.coordinator.GroupMetadataManager)

5 REPLIES 5

avatar
Expert Contributor

Adding the below had no effect in the nifi-app.log.

<appender name="APP_FILE">

.

<logger name="org.apache.nifi.processors.kafka.pubsub.ConsumeKafka" level="DEBUG" />

<logger name="org.apache.nifi.processors.kafka.pubsub.PublishKafka" level="DEBUG" />

.

</appender>

avatar
Expert Contributor

It gets stuck at the very first polling and never retrieves any messages.

avatar
Master Guru

is your cluster kerberized? do you have ranger enabled? is ranger plugin enabled for kafka? if yes to those questions, does nifi user have access to topic you are trying to consume from?

Also confirming you are using consumekafka and not the consumekafka_0_10 version?

avatar
Expert Contributor

Please see above log, you would notice NiFi can talk to Kafka. The issue appears to be with the poll that goes on indefinite wait OR cannot fetch within the specified timeout (both server, client), causing the single threaded consumer to timeout.

However, as requested NiFi is a standalone, but kerberized. NiFi user and the group have been authorized to access the topic. Yes, it's ConsumeKafka and not ConsumeKafka_0_10.

As far as enabling ranger is concerned, it is not, but do you see any reason with that with the above behavior?

avatar
Expert Contributor

Do you have this issue resolved? Can you tell me your solution if you manage to solve it?