/kafka-manager-docker

Kafka Manager Dockerfile

Primary LanguageShell

Kafka Manager Dockerfile

Kafka Manager is a tool for managing Apache Kafka developed by Yahoo Inc.

Description

The latest version of the docker image is based on:

The following actions will be performed during building a docker image:

  • install the additional packages (git, wget, tar, vim, mc, unzip, lsof)
  • kafka-manager home set to /opt/kafka-manager
  • delete all unused files (README.md bin/*.bat share/)
  • change debug level from INFO/WARN to ERROR into logback.xml and logger.xml files
  • set kafka-manager client port to 9000
  • define application.home -Dapplication.home=./
  • define ZK_HOST=localhost:2181
  • export JAVA_HOME
  • set TERM=xterm

How to build the image

If you want to build your own image, you should perform the following steps:

cd /tmp
git clone https://github.com/intropro/kafka-manager-docker.git
cd kafka-manager-docker/
docker build -t <NAME:TAG> .
rm -rf /tmp/kafka-manager-docker	

Example:

docker build -t kafka-manager:1.3.3.14 .

Create a container

Quick start

docker run -d -p <YOUR_PORT>:9000 -e ZK_HOSTS=<YOUR_ZK_CLUSTER:YOUR_ZK_PORT> --name <YOUR_CONTAINER_NAME> intropro/kafka-manager:latest

If you don't specify ZK_HOST variable, the default value "localhost:2181" will be used by a docker container.

Example:

docker run -d -p 9000:9000 -e ZK_HOSTS=zkdv-kdc01.ea.intropro.com:2181 --name kafka-manager intropro/kafka-manager:latest

Another way is to use a docker-compose file.

docker-compose -f <PATH_TO_DOCKER_COMPOSE_FILE>.yml up -d	

If zookeeper service is not running on the localhost, you need to define ZK_HOST variable in your docker-compose file.

Example:

docker-compose -f /opt/docker/kafka-manager.yml up -d

Use own configuration file

You can use your own configuration file via environment variable KM_CONFIG

docker run -d -p <YOUR-PORT>:9000 -e ZK_HOSTS=<YOUR_ZK_CLUSTER:YOUR_ZK_PORT> -v <PATH_TO_LOCAL_CONFIGDIR>:<CONTAINER_MOUNT_POINT> -e KMANAGER_CONFIG=<CONTAINER_MOUNT_POINT>/<YOUR_CONFIG_FILE> --name <YOUR_CONTAINER_NAME> intropro/kafka-manager:latest

Example:

docker run -d -p 9001:9000 -e ZK_HOSTS=kmgr-kdc01.ea.intropro.com:2181 -v /opt/kmm-config:/mnt -e KMANAGER_CONFIG=/mnt/application.conf --name kafka-manager intropro/kafka-manager:latest

Pass aditional arguments to the container

You can pass additional arguments into the Kafka Manager container through the JAVA_OPTS or/and KMANAGER_ARGS variables.

Example how to pass JAVA HEAP size:

docker run -d -p 9000:9000 -e ZK_HOSTS="kmgr-kdc01.ea.intropro.com:2181" -e JAVA_OPTS="-Xms512M -Xmx512M" --name kafka-manager intropro/kafka-manager

Example how to pass JAVA HEAP and own arguments:

docker run -d -p 9000:9000 -e ZK_HOSTS="kmgr-kdc01.ea.intropro.com:2181" -e JAVA_OPTS="-Xms512M -Xmx512M" -e KMANAGER_ARGS="-Dname=KafkaManager" --name kafka-manager intropro/kafka-manager

Change a revision

To upgrade or downgrade Kafka Manager change the KMANAGER_VERSION and KMANAGER_REVISION variables. You can also upgrade or downgrade Java version via the JAVA_MAJOR, JAVA_UPDATE, JAVA_BUILD, and JAVA_DOWNLOAD_HASH variables into the dockerfile.

Manage the docker container

Show the list of running containers.

docker ps

Show the list of all containers.

docker ps -a

start/stop/stats one or more containers

docker start <YOUR_CONTAINER_NAME>
docker stop <YOUR_CONTAINER_NAME>
docker stats <YOUR_CONTAINER_NAME>

support team - ampadm@intropro.com