We observed couple of errors / info messages while running Spark Streaming Applications, which might come handy for debugging in future. Refer below -
1) We noticed that Spark streaming Job was running but consuming nothing. We could see following messages being iteratively printed in logs -
22/11/18 08:13:53 INFO AbstractCoordinator: [Consumer clientId=consumer-1, groupId=difnrt-uat-001] Group coordinator mymachine.com:9093 (id: 601150796 rack: null) is unavailable or invalid, will attempt rediscovery
22/11/18 08:13:53 INFO AbstractCoordinator: [Consumer clientId=consumer-1, groupId=difnrt-uat-001] Discovered group coordinator mymachine.com:9093 (id: 601150796 rack: null)
22/11/18 08:13:53 INFO AbstractCoordinator: [Consumer clientId=consumer-1, groupId=difnrt-uat-001] (Re-)joining group
Possible Causes / Fixes -
- May be due to Kafka Coordinator service. Try restarting Kafka it may fix the issue.
- In our case, we couldn't get help from Admin Team. So, we changed "group.id" which resolved issue for us.
- It means that Client thread is being timed out before data is being written to Bootstrap server. There can be more reasons which can actually be derived from Kafka Server logs. Client logs don't provide much information.
- In our case, it was firewall issue with some nodes in cluster which could not connect to Kafka Bootstrap servers. So, it used to work but when tasks used to execute on machine which doesn't have firewall open - that's when application used to fail. To identify it -
- we did SSH to those nodes
- executed below command's to know if connection is possible -
- Opening firewall ports helped solve this intermittent problem.
- The reason for this error is that we are trying to fetch an offset which is greater then the current latest offset known by the broker. There can be multiple reasons for this behavior -
- On Kafka Side -
- set clean.leader.election.enable to false, such that there are no in-sync replicas.
- Restart Kafka after there are no in-sync replicas.
- Now, if offset was maintained by Kafka it should get corrected and re-running Spark Streaming application should work.
- In my case - it was due to coding error -
- We were maintaining offset manually in an HBase Table.
- Due to a coding error - we inserted wrong value in HBase Table.
- Next time when our Job ran it selected large offset from HBase Table which did not exists for the topic resulting in this error.
- We corrected our code and offset entries which resolved the issue.
Comments
Post a Comment