- edited on
Here is a fun one: how do you connect from Python in Cloudera Machine Learning to our Kafka datahub cluster?
The documentation is pretty thorough, but it does not have an example of a python client. That's what I'm going to highlight in this article.
The good news is that since CML and Datahub run in the same network, you don't need to worry about opening the broker ports, therefore you just need to follow these steps:
Then, open a session in CML, and use the following parameters:
from kafka import KafkaProducer
producer = KafkaProducer(bootstrap_servers=['<YOUR_BROKER_URL>:9093','<YOUR_BROKER_URL>:9093','<YOUR_BROKER_URL>:9093'],