NoBrokersAvailable: NoBrokersAvailable-Kafka Error

前端 未结 6 1136
南旧
南旧 2021-01-12 12:13

i have already started to learn Kafka. Trying basic operations on it. I have stucked on a point which about the \'Brokers\'.

My kafka is running but when i want to

6条回答
  •  别那么骄傲
    2021-01-12 12:56

    Don't know if this answer is still relevant but recently resolved this same problem in a VBox VM broker not reachable from host Windows OS. Since you have mentioned bootsrap_servers in KafkaConsumer, I assume you are using at least kafka 0.10.0.0

    Please look for the advertised.listeners property in server.properties file and set it to PLAINTEXT://localhost:9092 or PLAINTEXT://:9092

    But before you set that make sure your broker is reachable from the environment where your consumer is running (by doing ping localhost).

    Also, you need to restart the kafka-server and consumer/producer (whatever is running) and try sending/receiving.

    For example, if you are running VM, you may like to use Host-only adapter to make the broker reachable from host machine

    NOTE: This configuration works for Kafka Server >= 0.10.X.X but not for 0.8.2.X. Haven't checked for 0.9.0.X

提交回复
热议问题