Connection to node 0 (localhost/127.0.0.1:9092) could not be established. Broker may not be availabl
现象项目启动时出现kafka异常WARN 17821 --- [gateway-logback] org.apache.kafka.clients.NetworkClient: [Producer clientId=framework-gateway-logback] Connection to node 0 (localhost/127.0.0.1:9092) could not be esta
·
现象
项目启动时出现kafka异常
WARN 17821 --- [gateway-logback] org.apache.kafka.clients.NetworkClient : [Producer clientId=framework-gateway-logback] Connection to node 0 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.
WARN 17821 --- [gateway-logback] org.apache.kafka.clients.NetworkClient : [Producer clientId=framework-gateway-logback] Connection to node 0 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.
WARN 17821 --- [gateway-logback] org.apache.kafka.clients.NetworkClient : [Producer clientId=framework-gateway-logback] Connection to node 0 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.
WARN 17821 --- [gateway-logback] org.apache.kafka.clients.NetworkClient : [Producer clientId=framework-gateway-logback] Connection to node 0 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.
解决方案
- 修改kafka中server.properties配置,重启kafka,重启项目即可
# The address the socket server listens on. It will get the value returned from # java.net.InetAddress.getCanonicalHostName() if not configured. # FORMAT: # listeners = listener_name://host_name:port # EXAMPLE: # listeners = PLAINTEXT://your.host.name:9092 listeners=PLAINTEXT://10.10.5.131:9092
-
当kafka节点宕机时,也会出现类似错误。
更多推荐
所有评论(0)