kafka : Error UNKNOWN_MEMBER_ID occurred while committing offsets for group alert
来源:互联网 发布:商建刚 知产 编辑:程序博客网 时间:2024/06/07 07:11
2017-05-16最新:
经过2天的折腾,总算是解决了这个问题。
1.最开始遇到这个问题,总结为网络原因,可能确实是网络原因,但是需要解决。因此希望调大session.timeout,但是服务端没有设置,导致客户端无法调超过30s,所以没法调高超时时间等。而且感觉这个治标不治本!
2.尝试调低一次拉取的最大值,从而减少一次处理的条数。确实有收益,但是还需要继续!
3.尝试发现处理一条数据过程中耗时最久的一步,优化之。这次找到源头所在,处理逻辑中有一步是HTTP请求,这步有一些耗时25ms(batch commit?),当一次消费3W条数据(fetch size :5M),这步就非常耗时,并且某些时候可能会有网络原因导致阻塞?所以就导致了整个poll循环出现本文的问题。发现方法:注释掉sendKafka().解决方法:sendKafka()改为异步处理,send()只是put in memory BlockQueue。
这次基本算是解决了问题。另外中途遇到了:faild allocate memory within max.bolck.ms
解决:
batch.size 1024 -> 10240
max.block.ms 1000不变
buffer.memory 4096 -> 40960
总结:这个问题是必然报出来的,因为确实不该在poll循环里面做非常耗时的、不稳定的逻辑.一定要注意一切有关网络开销、数据库等的。
附.消费者配置
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
本地跑消费kafka数据,发现ERROR,网上找到这个哥们的:
http://stackoverflow.com/questions/38394662/error-unknown-member-id-occurred-while-committing-offsets-for-group-xxx
https://cwiki.apache.org/confluence/display/KAFKA/KIP-41%3A+KafkaConsumer+Max+Records
大概意思就是说消费不过来,数据太大。自动commit超时了。
解决:
- max.partition.fetch.bytes:一次拉取最大byte这个属性 小一点.默认1M
- session.timeout.ms:超时时间设置大一点
准备改的时候,想了一想,先看看我这程序能处理多少,结果一跑起来才发现,压根不是程序的锅。本地网络波动导致的!因为这个线程没用到Redis,但是这个异常每次都和redis timeout一起报,
我设置的 poll(100 ms). max.partition.fetch.bytes没设置,默认1M,
然后打印了消费5000条数据情况下耗时,是1s。所以白担心了一场,不过也学到了一些东西。
总结:
遇到错不一定就是程序的锅。其他环境、引用都有可能导致ERROR!!!
kafka客户端性能优化参考:
http://www.jianshu.com/p/4e00dff97f39
2017-05-15
今天部署到服务器又报这个异常,
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
看来确实在某些时刻,程序无法消费过来,调高一下心跳时间试试:
heartbeat.interval.ms 25000 》 60000
参考文章:
http://blog.csdn.net/xianzhen376/article/details/51802736
Kafka源码深度解析-序列7 -Consumer -coordinator协议与heartbeat实现原理
http://blog.csdn.net/chunlongyu/article/details/52791874
http://blog.csdn.net/stark_summer/article/details/50203133
转载于:http://blog.csdn.net/jinzhencs/article/details/71713707
- kafka : Error UNKNOWN_MEMBER_ID occurred while committing offsets for group alert
- kafka : Error UNKNOWN_MEMBER_ID occurred while committing offsets for group alert
- Error UNKNOWN_MEMBER_ID occurred while committing offsets for group ***
- Unexpected error occurred while trying to check for group existence.
- IAR FOR STM8S 错误 An error occurred while retrieving GDI features: gdi-error [40201]解决方法
- Error 25003. Error occurred while initializing fusion
- [DeploymentService:290066]Error occurred while downloading files from admin server for deployment re
- Android Studio 中 An error occurred while creating the AVD.See idea.log for detail
- An error occurred while updating the entries. See the inner exception for details.解决方案
- Error occurred while downloading files from Administration Server for deployment request
- an error occurred while mounting /home 解决方法
- Error occurred while loading modules from classpath
- The error occurred while processing mapper_resultMap[DrugConditionResult]
- Eclipse : An error occurred while filtering resources
- An error occurred while installing system .....github
- The error occurred while setting parameters
- eclipse:an error occurred while filtering resources
- an error occurred while processing the directive
- iOS
- Android 利用java的注解方法快速keep住混淆实践操作
- PHP中调用move_uploaded_file函数提示failed to open stream和 Unable to move
- 月薪过万的程序员都培训的什么编程语言?
- JSP中forward与response重定向区别
- kafka : Error UNKNOWN_MEMBER_ID occurred while committing offsets for group alert
- 回声消除原理
- ubuntu 基础学习
- Google Chrome 中安装 PostMan 扩展
- 基数排序
- Spring Boot工程中如果有多个main()函数,需要指定启动类
- eclipse开发web项目时如何自动将web项目部署到tomcat的webapps目录下
- windows下boost编译好的库下载地址
- 总结kafka的consumer消费能力很低的情况下的处理方案