'Kafka producer timeout on Ubuntu over VPN

I recently switched from a Windows laptop to an Ubuntu laptop for work related developement.

We have a kafka server - lets call it my-kafka-server - and I have not had any issues consuming and producing messages from my Windows laptop, be it on site or over VPN.

On my Ubuntu laptop however I connect to a different VPN server, and I have had to ask for port openings related to this VPN server for many of the hosts and ports I depend upon. The kafka broker was no exception. It is a single node cluster (yes I know) - and I have requested opening of 2181 (zookeper) as well as 9092, 9093 and 9094 for the kafka nodes.

I am now able to consume message, but I am still consistently unable to produce messages. All my efforts end similar to this:

m66523@m66523-ThinkPad-X280:~/kafka/kafka_2.13-3.0.0/bin$ echo "Hello, World" | ./kafka-console-producer.sh --bootstrap-server my-kafka-server:9092 --topic alive-test
[2022-02-03 12:33:39,598] ERROR Error when sending message to topic alive-test with key: null, value: 12 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
org.apache.kafka.common.errors.TimeoutException: Expiring 1 record(s) for alive-test-0:120001 ms has passed since batch creation

Does anyone hoave an idea - what am I missing?



Solution 1:[1]

Opening the ports 9093 and 9094 solved the issue :-)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jens Krogsboell