doujiang24 / lua-resty-kafka

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

_fetch_metadata(): all brokers failed in fetch topic metadata, #162

Open kfrtiamo opened 4 months ago

kfrtiamo commented 4 months ago

local producer = require "resty.kafka.producer"

local brokers = { { host = "10.154.46.66", port = 9092 } } local producer_config = { ["bootstrap.servers"] = "10.154.46.66:9092", ["sasl.username"] = "xxxxx", ["sasl.password"] = "xxxxxxxxg", ["sasl.mechanism"] = "PLAIN", ["security.protocol"] = "SASL_PLAINTEXT" }

local p, err = producer:new(producer_config)

if not p then ngx.log(ngx.ERR, "failed to create kafka producer: ", err) ngx.say(ngx.ERR, "failed to create kafka producer: ", err) return else ngx.say(ngx.ERR, "create kafka producer: ", err) end

一直报 2024/02/20 14:50:30 [error] 27622#0: 15 [lua] client.lua:151: _fetch_metadata(): all brokers failed in fetch topic metadata, client: 10.139.152.93, server: localhost, request: "POST /isales-open-agc-transporter/buryingPoint/push HTTP/1.1", host: "10.154.44.214" 2024/02/20 14:50:30 [error] 27622#0: 15 [lua] buryingPointSend.lua:124: not 1 failed to send message: not found topic, client: 10.139.152.93, server: localhost, request: "POST /isales-open-agc-transporter/buryingPoint/push HTTP/1.1", host: "10.154.44.214" 什么问题导致的呢