SpringBoot整合kafka报could not be established. Broker may not be available.
报错日志
1[AdminClient clientId=adminclient-1] Connection to node 0 (localhost/127.0.0.1:9092) could not be established. Broker may not be available. 2[AdminClient clientId=adminclient-1] Connection to node 0 (localhost/127 .0.0.1:9092) could not be established. Broker may not be available. 3[AdminClient client Id=adminclient-1] Connection to node 0 (localhost/127 .0.0.1:9092) could not be established. Broker may not be available. 4[AdminClient clientId= adminclient-1] Connection to node 0 (localhost/127 .0.0.1:9092) could not be established. Broker may not be available. 5[AdminClient clientId=adminclient-1] Connection to node 0 (localhost/127 .0.0.1:9092) could not be established. Broker may not be available. 6[AdminClient client Id=adminclient-1] Connection to node 0 (localhost/127 .0.0.1:9092) could not be established. Broker may not be available. 7[ AdminClient client Id-adminclient-1] Connection to node 0 (localhost/127 .0.0.1:9092) could not be established. Broker may not be available. 8[AdminClient client Id=adminclient-1] Connection to node 0 (localhost/127 .0.0.1:9092) could not be established. Broker may not be available.
解决,修改kafka的server.properties
1listeners=PLAINTEXT://kafka-host:9092 2advertised.listeners=PLAINTEXT://kafka-host:9092
例如:
