dpkp / kafka-python

Python client for Apache Kafka
http://kafka-python.readthedocs.io/
Apache License 2.0
5.53k stars 1.39k forks source link

NoBrokersAvailable #2208

Open aa1633350 opened 3 years ago

aa1633350 commented 3 years ago

While trying to run the producer I keep on getting this issue, I have tried adding api_version to the code but its not working. Can anybody help

Traceback (most recent call last): File "C:/Users/Aditya Anand/Nudity_detection-on-Live-Video-Stream/consumer.py", line 12, in consumer = KafkaConsumer( File "C:\Users\Aditya Anand\AppData\Local\Programs\Python\Python38\lib\site-packages\kafka\consumer\group.py", line 356, in init self._client = KafkaClient(metrics=self._metrics, **self.config) File "C:\Users\Aditya Anand\AppData\Local\Programs\Python\Python38\lib\site-packages\kafka\client_async.py", line 244, in init self.config['api_version'] = self.check_version(timeout=check_timeout) File "C:\Users\Aditya Anand\AppData\Local\Programs\Python\Python38\lib\site-packages\kafka\client_async.py", line 927, in check_version raise Errors.NoBrokersAvailable() kafka.errors.NoBrokersAvailable: NoBrokersAvailable

Process finished with exit code 1

mmenbawy commented 3 years ago

Is your Kafka server up and healthy? Are you providing the correct Kafka server URL to the Kafka client?

HWTsang commented 3 years ago

It may be necessary to edit C:\Windows\System32\drivers\etc\HOSTS to add your ip and hostname for windows 192.168.101.100 centos01