Kafbat and Kafka using WSL
Kafbat container connect to local WSL Kafka on Windows.
Introduction
I wanted to set up a quick dev environment on my Windows machine, using linux (WSL). Didn't want to spend too much time on this but eventually wasted 2 hours.
Hopefully this will help you get going quickly.
Aim
To get a local kafka broker running and use Kafbat UI to connect to it.
Running Kafbat UI
docker run -it -p 8080:8080 --net="host" -e DYNAMIC_CONFIG_ENABLED=true ghcr.io/kafbat/kafka-ui
The --net=host allows it to form part of the machines network and understand hosts.
My WSL /etc/hosts file already had an entry created as shown below. So I needed to use the same hostname :
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateHosts = false
127.0.0.1 localhost
127.0.1.1 E1509.internal.mycompany.com E1509
Kafka Setup
I altered the Advertised Listeners in my server.properties:
listeners = PLAINTEXT:// E1509.internal.mycompany.com:9092
Started the Kafka server and connected to it from my Kafbat UI.
Everything works, now can work on my POC!
Comments
Post a Comment