远程Kafka消费者

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

我在另一台机器上有一个3节点的kafka集群,我无法用spring启动应用程序远程连接和使用消息。我已将配置文件更改为:

advertised.listeners=PLAINTEXT://<myActual IP address>:9092

这是我的申请表

spring:
  kafka:
    consumer:
      bootstrap-servers: :9092,:9093,:9094
      group-id: test-consumer-group
      auto-offset-reset: earliest
      key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
      value-deserializer: org.apache.kafka.common.serialization.StringDeserializer

运行应用程序时,出现以下错误:

2020-10-26 12:47:52.524 WARN 4524 --- [| adminclient-1] 
org.apache.kafka.clients.NetworkClient : [AdminClient clientId=adminclient-1] 
Connection to node -1 (localhost/127.0.0.1:9092) could not be established. 
Broker may not be available.
lsmepo6l

lsmepo6l1#

bootstrap-servers: :9092,:9093,:9094 您需要指定主机名或ip地址。 bootstrap-servers: some.host:9092,some.host:9093,some.host:9094

相关问题