lua-resty-kafka使用问题!

230 views
Skip to first unread message

熊云昆

unread,
Apr 7, 2017, 7:08:03 AM4/7/17
to open...@googlegroups.com
hi,
我在使用lua-resty-kafka模块的时候,有这样的问题:
local broker_list = {
    { host = "192.168.1.98", port = 9092 },
}
local p = producer:new(broker_list)
local offset, err = p:send("test", "key", "hello")
if not offset then
    ngx.say("send err:", err)
    return
end
ngx.say("send success, offset: ", tonumber(offset))
nginx的错误日志中报错:
[lua] producer.lua:258: buffered messages send to kafka err: localhost could not be resolved (3: Host not found), retryable: true, topic: logstash, partition_id: 0, length: 1, context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:7633
这里提示 localhost could not be resolved,但是我的broker_list里面并没有localhost这个,不知道什么原因?你们有碰见过吗?



 

DeJiang Zhu

unread,
Apr 9, 2017, 2:14:47 AM4/9/17
to open...@googlegroups.com



 

--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty+subscribe@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+unsubscribe@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html

熊云昆

unread,
Apr 9, 2017, 9:41:25 PM4/9/17
to open...@googlegroups.com
谢谢!解决了
订阅: 请发空白邮件到 openresty+subs...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+unsub...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages