Sign inSign up

technolords/kafka

By technolords

•Updated almost 8 years ago

An image for Kafka which includes a health check

Image
0

10K+

technolords/kafka repository overview

⁠Introduction

This image does not start an embedded Zookeeper, instead the image relies on a Zookeeper to be present elsewhere. This enables cluster deployments without Zookeeper hassle. See also:

In addition, the image comes with a health check. This health check is based on native JMX information to keep it pure, rather than sending messages to some kind of test topic. For more details, see:

This image can be used for Openshift/Kubernetes deployments as well.

The latest image uses Kafka 2.0.0

⁠Usage

See example below (assuming the Kafka cluster to be running in a separate network):

#!/bin/bash
echo "About to start Kafka-1 as docker container..."
docker run --detach \
    --name kafka-1 \
    --restart yes \
    --network="kafka-cluster" \
    --ip="192.168.100.100" \
    --volume /var/data/kafka1/config:/etc/kafka/install/config \
    --volume /var/data/kafka1/data:/etc/kafka/install/data \
    --volume /var/data/kafka1/logs:/etc/kafka/install/logs \
    --env "KAFKA.BROKER.ID=1" \
    --env "KAFKA.ZOOKEEPER.CONNECT=192.168.100.10:2181,192.168.100.11:2181,192.168.100.12:2181" \
    --env "KAFKA.WHAT.EVER=sample" \
    technolords/kafka:latest
echo "...done!"

⁠Volumes

The image knows three volumes:

  • config, the location of the configuration files
  • data, the location of the data associated with the topics
  • log, the location of the Kafka logs (i.e. log4j)

Note that the volumes must have ownership of an user with uid 500. This is required as Kafka runs as non-root.

⁠Environment variables

For the environment variable to be picked up, it must be prefixed with KAFKA. as the example shows. If the key does not exist (initially), it will be added to the server.properties file otherwise it will be updated. Using the example above will cause the property what.ever=sample to be added.

The broker.id must be an unique integer, and zookeeper.connect is a comma separated list of ZooKeeper instances.

For more properties, see:

Tag summary

Content type

Image

Digest

Size

340.9 MB

Last updated

almost 8 years ago

docker pull technolords/kafka