nginx+lua写入kafka报buffered messages send to kafka err: not found broker

缘起

生产环境突然报:

[error] 9#0: *4029703 [lua] producer.lua:272: buffered messages send to kafka err: not found broker, retryable: true, topic: xxxx, partition_id: 11, length: 2

解决

在 kafka lua客户端的github issues中找到了答案:

创建producer时, 加上刷新时间,
local prod = producer:new(broker_list, { producer_type = “async”, refresh_interval=10000})
默认是不刷新的, 当broker故障时, 会刷新一次元数据, 但是当broker恢复以后, 客户端是不会自动刷新元数据的。

截图如下:
nginx+lua写入kafka报buffered messages send to kafka err: not found broker_第1张图片
地址:https://github.com/doujiang24/lua-resty-kafka/issues/147

kafka lua客户端地址:https://github.com/doujiang24/lua-resty-kafka

你可能感兴趣的:(linux,JAVA,lua,nginx,kafka)