kafka-python

NoBrokersAvailable: NoBrokersAvailable-Kafka Error

不打扰是莪最后的温柔 提交于 2019-12-01 22:23:39
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 create a partition. from kafka import TopicPartition (ERROR THERE) consumer = KafkaConsumer(bootstrap_servers='localhost:1234') consumer.assign([TopicPartition('foobar', 2)]) msg = next(consumer) traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-packages/kafka/consumer/group.py", line 284, in init self._client = KafkaClient(metrics=self._metrics, **self.config) File "/usr/local/lib/python2.7

kafka-python: producer is not able to connect

若如初见. 提交于 2019-11-29 03:48:10
kafka-python (1.0.0) throws error while connecting to the broker. At the same time /usr/bin/kafka-console-producer and /usr/bin/kafka-console-consumer work fine. Python application used to work well also, but after zookeeper restart, it no longer can connect. I am using bare bones example from the docs: from kafka import KafkaProducer from kafka.common import KafkaError producer = KafkaProducer(bootstrap_servers=['hostname:9092']) # Asynchronous by default future = producer.send('test-topic', b'raw_bytes') I am getting this error: Traceback (most recent call last): File "pp.py", line 4, in

kafka-python: producer is not able to connect

瘦欲@ 提交于 2019-11-27 17:46:26
问题 kafka-python (1.0.0) throws error while connecting to the broker. At the same time /usr/bin/kafka-console-producer and /usr/bin/kafka-console-consumer work fine. Python application used to work well also, but after zookeeper restart, it no longer can connect. I am using bare bones example from the docs: from kafka import KafkaProducer from kafka.common import KafkaError producer = KafkaProducer(bootstrap_servers=['hostname:9092']) # Asynchronous by default future = producer.send('test-topic',