SpringBoot整合kafka報could not be established. Broker may not be available.
報錯日誌node
[AdminClient clientId=adminclient-1] Connection to node 0 (localhost/127.0.0.1:9092) could not be established. Broker may not be available. [AdminClient clientId=adminclient-1] Connection to node 0 (localhost/127 .0.0.1:9092) could not be established. Broker may not be available. [AdminClient client Id=adminclient-1] Connection to node 0 (localhost/127 .0.0.1:9092) could not be established. Broker may not be available. [AdminClient clientId= adminclient-1] Connection to node 0 (localhost/127 .0.0.1:9092) could not be established. Broker may not be available. [AdminClient clientId=adminclient-1] Connection to node 0 (localhost/127 .0.0.1:9092) could not be established. Broker may not be available. [AdminClient client Id=adminclient-1] Connection to node 0 (localhost/127 .0.0.1:9092) could not be established. Broker may not be available. [ AdminClient client Id-adminclient-1] Connection to node 0 (localhost/127 .0.0.1:9092) could not be established. Broker may not be available. [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.propertiesspa
listeners=PLAINTEXT://kafka-host:9092 advertised.listeners=PLAINTEXT://kafka-host:9092
例如:
日誌