Kafka Error while fetching metadata with correlation id 1 : {alarmHis=LEADER_NOT_AVAILABLE}

environment

springboot2 + kafka_ Kafka is a stand-alone environment

Error report

Error while fetching metadata with correlation id 1 : {alarmHis=LEADER_NOT_AVAILABLE}

Cause of error

Error getting metadata with correlation ID XX

Problem solving

    1. Modify

config\ server.properties , as follows:

listeners=PLAINTEXT://localhost:9092
advertised.listeners=PLAINTEXT://localhost:9092

Restart Kafka and start the program to store

result

Smooth solution

Read More: