无法与kafka broker建立kafka连接

4ktjp1zp  于 2021-06-04  发布在  Kafka
关注(0)|答案(1)|浏览(562)

我使用mac和安装zookeeper和Kafka通过

brew install confluent-platform

通过使用以下命令,

zookeeper-server-start /usr/local/etc/kafka/zookeeper.properties
kafka-server-start /usr/local/etc/kafka/server.properties
connect-distributed /usr/local/etc/kafka/connect-distributed.properties

但是,连接器会显示以下消息,例如

[2020-08-05 09:53:40,222] WARN [Producer clientId=inventory-connector2-dbhistory] Connection to node -1 (kafka/223.82.248.117:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient:756)
[2020-08-05 09:53:40,230] WARN [Producer clientId=inventory-connector2-dbhistory] Bootstrap broker kafka:9092 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient:1024)
[2020-08-05 09:53:40,427] WARN [Producer clientId=inventory-connector-dbhistory] Connection to node -1 (kafka/223.82.248.117:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient:756)

我在localhost中启动了kafka代理,但是正如消息所示,代理的地址是223.82.248.117:9092。
我该怎么修?

vq8itlhq

vq8itlhq1#

你需要设置 advertised.listenersserver.properties 成为 localhost:9092 那么 bootstrap.serversconnect-*.properties 也指向那里

相关问题