【问题标题】:Apache kafka server start binds to at path /brokers/ids/0 with addresses deploy.static.akamaitechnologies.com:9092 instead of localhostApache kafka 服务器启动绑定到路径 /brokers/ids/0,地址为 deploy.static.akamaitechnologies.com:9092 而不是 localhost
【发布时间】:2022-01-20 03:18:41
【问题描述】:

我正在尝试在本地运行 apache kafka,zookeeper 运行良好并使用 localhost 绑定到端口 2181。当我启动 kafka 服务器时,它失败并出现以下错误。可能是什么原因?

WARN [Controller id=0, targetBrokerId=0] Connection to node 0 
(a23-202-231-169.deploy.static.akamaitechnologies.com/23.202.231.169:9092)
could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient) 

【问题讨论】:

  • 你能显示服务器配置吗?

标签: apache-kafka apache-zookeeper


【解决方案1】:

默认情况下,Kafka 属性中的listeners=PLAINTEXT://:9092 将使用代理主机名。如果您只想要本地连接,请将其更改为 listeners=PLAINTEXT://127.0.0.1:9092

对于客户端连接,您还需要配置 advertised.listeners,它控制返回给客户端的 IP/主机名

【讨论】:

  • 我在我的另一台 Mac 上有这个服务器配置,它工作得非常好,根本不需要修改监听器配置。
  • # 套接字服务器监听的地址。如果未配置,它将获取从 # java.net.InetAddress.getCanonicalHostName() 返回的值。 # 格式:# listeners = listener_name://host_name:port # 示例:# listeners = PLAINTEXT://your.host.name:9092 #listeners=PLAINTEXT://:9092
  • 对于我遇到此问题的机器,我根据您的建议进行了如下更改,它开始工作##################### ####### 套接字服务器设置############################ 套接字服务器侦听的地址。如果未配置,它将获取从 # java.net.InetAddress.getCanonicalHostName() 返回的值。 # 格式:# listeners = listener_name://host_name:port # 示例:# listeners = PLAINTEXT://your.host.name:9092 listeners=PLAINTEXT://127.0.0.1:9092
猜你喜欢
  • 2011-01-12
  • 2016-11-10
  • 2021-03-15
  • 2020-12-01
  • 2017-03-21
  • 1970-01-01
  • 2017-11-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多