Skip to content

A 3 node Kafka Cluster running in KRaft mode in Docker with a simple GUI to browse topics and msgs.

License

Notifications You must be signed in to change notification settings

nandak522/kraft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What you get

Build

docker build -t local/kafka-base:v3.5.0 .

Run

docker compose up kafka1 kafka2 kafka3 kafka-ui

kafka1, kafka2 and kafka3 use the above common/base image local/kafka-base:v3.5.0

Test using Metrics

PORT=39999
unset KAFKA_JMX_OPTS && unset JMX_PORT && /opt/kafka/bin/kafka-run-class.sh org.apache.kafka.tools.JmxTool \
  --one-time true \
  --jmx-url service:jmx:rmi:///jndi/rmi://:${PORT}/jmxrmi \
  --object-name kafka.controller:type=KafkaController,name=ActiveControllerCount

The above command should give an output like:

Trying to connect to JMX url: service:jmx:rmi:///jndi/rmi://:39999/jmxrmi
time,"1688110063561"
kafka.controller:type=KafkaController,name=ActiveControllerCount:Value,"1"

P.S: Above unsetting of certain env vars is because running the above kafka-run-class.sh command with JMX_PORT being set is throwing a weird Port/Address already in use exception.

About

A 3 node Kafka Cluster running in KRaft mode in Docker with a simple GUI to browse topics and msgs.

Topics

Resources

License

Stars

Watchers

Forks