0

I have a setup a local kafka node that I want to open to the open world.

I have seen this question which seems very similar. I have opened that port using the advertised listeners to localhost:9092 and I opened that port the node, but when I'm trying to produce a message using kafkajs I get the following error :

{"level":"ERROR","timestamp":"2021-06-01T13:49:35.225Z","logger":"kafkajs","message":"[Connection] Connection error: connect EHOSTUNREACH 13.36.134.166:9092","broker":"13.36.134.166:9092","clientId":"my-app","stack":"Error: connect EHOSTUNREACH 13.36.134.166:9092\n at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)"}

Am I missing a big step here ? Is using localhost to designate the advertised port ?

Many thanks ! Kev.

Kevin Heirich
  • 109
  • 2
  • 12
  • 1
    Have you added `listeners=PLAINTEXT://0.0.0.0:9092` in server.properties? – Achyut Vyas Jun 01 '21 at 16:39
  • 1
    The error says either `13.36.134.166` is blocked, or `:9092` at that address is not allowed through the firewall, or the server itself has not opened that port. You can use `nc -vz 13.36.134.166 9092` as a very basic network check rather than write Kafka code. Advertising localhost is definitely not correct – OneCricketeer Jun 01 '21 at 20:17
  • Ho.. well I've added `localhost:9092` instead of an other adress in the `server.properties`file... I'll have to try with `0.0.0.0` – Kevin Heirich Jun 02 '21 at 07:31

0 Answers0