Skip to content

A lightweight toolkit to run Apache Kafka and Zookeeper locally using Docker Compose, with easy start/stop/status scripts

Notifications You must be signed in to change notification settings

ropereraLK/kafka-toolbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kafka Toolbox

A lightweight toolkit to run Apache Kafka and Zookeeper locally using Docker Compose, with easy start/stop/status scripts.


Project Structure

kafka-toolbox/
├── one-time-setup.sh       # One-time setup: fixes permissions for all scripts
├── start-kafka.sh          # Start Kafka + Zookeeper
├── stop-kafka.sh           # Stop Kafka + Zookeeper
├── status-kafka.sh         # Check if containers are running
├── config/
│   ├── local.env           # Kafka & Zookeeper versions and config
│   └── docker-compose.yml  # Docker Compose file for Kafka + Zookeeper
└── util/
    ├── docker/
    │   └── docker-setup.sh # Check Docker installation and daemon
    └── kafka/
        └── kafka-setup.sh  # Pull Kafka & Zookeeper images if needed

Prerequisites

  • Linux system
  • Docker
  • Docker Compose (V2 plugin included in Docker)

The scripts include checks for Docker installation and daemon.


One-time Setup

Run the setup script once to fix permissions for all scripts:

chmod +x one-time-setup.sh
./one-time-setup.sh

This ensures you can run all scripts without permission issues.


Configuration

Edit config/local.env to set your desired Kafka & Zookeeper versions:

KAFKA_VERSION=4.1.1
ZOOKEEPER_VERSION=3.9.0
DOCKER_NETWORK=kafka-network

Start Kafka

./start-kafka.sh

Expected output:

✅ Docker is available and running.
✅ Kafka Docker image already exists
✅ Zookeeper Docker image already exists
✅ Kafka environment is ready!
📦 Starting Kafka using docker compose...
✅ Kafka started successfully!
📡 Brokers running on: localhost:9092

Stop Kafka

./stop-kafka.sh

Expected output:

📦 Stopping Kafka using docker compose...
✅ Kafka and Zookeeper stopped successfully!

Status

./status-kafka.sh

Output:

✅ Kafka container is running: kafka
✅ Zookeeper container is running: zookeeper

Utilities

  • util/docker/docker-setup.sh → Checks Docker installation & daemon.
  • util/kafka/kafka-setup.sh → Pulls Kafka & Zookeeper images if not present.

About

A lightweight toolkit to run Apache Kafka and Zookeeper locally using Docker Compose, with easy start/stop/status scripts

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages