doujiang24 / lua-resty-kafka

Lua kafka client driver for the Openresty based on the cosocket API
BSD 3-Clause "New" or "Revised" License
802 stars 275 forks source link

producer.lua:258: buffered messages send to kafka err: no resolver defined to resolve ip #68

Closed sstong123 closed 6 years ago

sstong123 commented 6 years ago

In kafka server.properties, the host.name and advertised.host.name are set to 10.190.20.144,port is:9090. And on the nginx server,the command:

telnet 10.190.20.144 9090

works fine.

my producer code as below: broker_list = { { host = "10.190.20.144", port = 9090 }, .... } local bp = producer:new(broker_list, { producer_type = "async" }) local ok, err = bp:send("test", key, message);

but when I send the request to nginx,I got the message in error.log below: 018/06/10 23:05:43 [error] 14518#0: [lua] producer.lua:258: buffered messages send to kafka err: no resolver defined to resolve "10.190.20.144 ", retryable: true, topic: test, partition_id: 76, length: 1, context: ngx.timer, client: 220.110.201.20, server: 0.0.0.0:80

even add resolver 114.114.114.114 or 8.8.8.8; in the nginx.conf ,but also can not send the message to kakfa.

how to resolve it?

doujiang24 commented 6 years ago
no resolver defined to resolve "10.190.20.144 "

have you noticed there is a space after 144? I guess it's your mistake.

sstong123 commented 6 years ago

yes,there's a blank after the ip in kafka broker config file. Thanks!