Closed lovemelovemycode closed 8 years ago
1 出现错误的代码行: producer.lua ---》local function _send(self, broker_conf, topic_partitions)---》resp, err, retryable = bk:send_receive(req)
2 err信息:no resolver defined to resolve "datanode03.jj.wl"
@lovemelovemycode You can find answers from: https://github.com/doujiang24/lua-resty-kafka/issues/21 https://github.com/doujiang24/lua-resty-kafka/issues/5
considered resolved
1 部署环境 openresty-1.9.15.1.tar.gz + 最新lua-resty-kafka + CDH5.4.0(kafka1.3.0)+ CentOS6.4 64位
2 lua-resty-kafka相应的nginx配置文件内容
server { listen 8081; server_name 192.168.15.84; location /test { content_by_lua ' local cjson = require "cjson" local client = require "resty.kafka.client" local producer = require "resty.kafka.producer"
}
3 请求例子 curl -X POST -H ' charset=UTF-8' -d 'sssss' http://192.168.15.84:8081/test
4 出现的问题(数据不能写入kafka),日志详情如下: 2016/06/21 18:10:30 [error] 22381#0: *1 lua entry thread aborted: runtime error: content_by_lua(lua-kafka.conf:50):21: Cannot serialise table: excessively sparse array stack traceback: coroutine 0: [C]: in function 'encode' content_by_lua(lua-kafka.conf:50):21: in function <content_by_lua(lua-kafka.conf:50):1>, client: 192.168.15.84, server: 192.168.15.84, request: "POST /test HTTP/1.1", host: "192.168.15.84:8081"
5 非常感谢,期待您的回答。