Reputation: 2078
I have a problem with NodeJS (I think) using a kafka node on a node-red instance installed on a RPI3.
Scenario: I have a cluster with a running instance of Kafka. The real ip of the machine which host the kafka broker is private so I have a public ip with a public port which I can use. Then, the requests are redirected to the broker.
Testing my environment with a broker installed on my laptop (so knowing the real ip of the broker) everything works fine. Performing an attempt on the real cluster node-red shows the problem described in the terminal:
So, I took a look in js file representing the kafkaNode I used and I find this:
I'm quite sure the problem is in these line and in the use of the ip redirection. Anyway, honestly I'm a newbie of Nodejs and javascript so I don't know if there are some bugs about use of it. Any ideas?
P.S.: I'm sure that kafka broker is correctly running and installed. the problem is exactly in js. I also tried to reach the "fake ip" with telnet, and it works fine.
Thanks in advance
Upvotes: 0
Views: 219
Reputation: 8335
Kafka does not work with default values configured if you use a NAT, VM, or other proxy for "ip redirection" because the clients dynamically discover the private IPs of the real kafka brokers and will try to connect directly to those IP addresses and not just the one you configure in your client for the initial connection and meta-data request.
You need to make sure that the broker is setup to advertise the hostname or IP of the machine doing the redirection or your producers will not work.
Upvotes: 1