Skip to content

victoriza/docker-kafka-zookeeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Docker Kafka Zookeeper

This repository provides everything you need to run Kafka in Docker.

Why?

The main hurdle of running Kafka in Docker is that it depends on Zookeeper. Compared to other Kafka docker images, this one runs both Zookeeper and Kafka in the same container. This means:

  • No dependency on an external Zookeeper host, or linking to another container
  • Zookeeper and Kafka are configured to work together out of the box

Build

docker build -t kafka-zookeeper:latest .

Run container

docker run -p 2181:2181 -p 9092:9092 -e ADVERTISED_HOST=<YOUR_HOST> kafka-zookeeper:latest

Test

Create topic

kafka-topics --create --zookeeper <YOUR_HOST>:2181 --replication-factor 1 --partitions 1 --topic test

Run Kafka console consumer (ssh)

bin/kafka-console-consumer --bootstrap-server <YOUR_HOST>:9092 --topic test

Run Kafka console producer (ssh)

bin/kafka-console-producer --broker-list <YOUR_HOST>:9092 --topic test
banana!

Verify messages been received in console consumer

banana!

Credits

Originally cloned and inspired by https://github.com/spotify/docker-kafka

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages