Questions & Answers

RED- PNDA Kafka remote producer? (with sample code)

0 votes
asked Sep 27, 2017 by Jim (120 points)
edited Sep 28, 2017 by Jim

I tried to set up a kafka remote producer so to feed data into RESD-PNDA. However, I hit by the error 'kafka.errors.NoBrokersAvailable: NoBrokersAvailable', even thought my netcat to the remote ip address:9092 (where red-pnda is running) is successed. Any clue or fix? Has anyone tried to setup remoted producer? All example codes are using 'localhost' etc.

BTW, the local producer verified and works. The default OVA file for the RED-PNDA is used.

The code in the remote producer is as:

import io
import sys, getopt, time
import datetime
import random
from kafka import KafkaProducer
import ssl
import json

producer = KafkaProducer(bootstrap_servers=["192.168.255.171:9092"])

(the ip address is the remote machine running RED-PNDA; ping/netcat are successed)

The error message is as:

    traceback.print_stack()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/kafka/producer/kafka.py", line 347, in __init__
    **self.config)
  File "/usr/local/lib/python2.7/dist-packages/kafka/client_async.py", line 220, in __init__
    self.config['api_version'] = self.check_version(timeout=check_timeout)
  File "/usr/local/lib/python2.7/dist-packages/kafka/client_async.py", line 861, in check_version
    raise Errors.NoBrokersAvailable()
kafka.errors.NoBrokersAvailable: NoBrokersAvailable

1 Answer

0 votes
answered Sep 28, 2017 by 91pavan (260 points)
edited Sep 28, 2017 by 91pavan
Hi Jim,

Can you share the code which you're using to connect to the kafka producer?
...