A.GARMES
A.GARMES

Reputation: 61

kafka producer and broker in different servers

My problem is: how can I send data from a kafka producer to broker? the schema below explains my network configuration :

I have a producer in VM which is located in server A, and my broker too is in VM which is located in Server B.

I use an SSH connection from my producer VM to the server B with a redirection port : ssh -L 9092:192.168.56.101:9092 xx@IP1

I use kafka console to test :

bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test

thanks

Upvotes: 0

Views: 1421

Answers (1)

hivie7510
hivie7510

Reputation: 1246

You need to set the --broker-list to wherever the broker resides. In your code, you are saying that I want to produce a message and send it to a broker that is on the localhost machine at port 9092. Try bin/kafka-console-producer.sh --broker-list 192.168.56.101:9092 --topic test

Upvotes: 1

Related Questions