docker-kafka

Kafka (and Zookeeper) in Docker

  • 所有者: spotify/docker-kafka
  • 平台:
  • 許可證: Apache License 2.0
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Kafka in Docker

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

For convenience also contains a packaged proxy that can be used to get data from
a legacy Kafka 7 cluster into a dockerized Kafka 8.

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

Run

docker run -p 2181:2181 -p 9092:9092 --env ADVERTISED_HOST=`docker-machine ip \`docker-machine active\`` --env ADVERTISED_PORT=9092 spotify/kafka
export KAFKA=`docker-machine ip \`docker-machine active\``:9092
kafka-console-producer.sh --broker-list $KAFKA --topic test
export ZOOKEEPER=`docker-machine ip \`docker-machine active\``:2181
kafka-console-consumer.sh --zookeeper $ZOOKEEPER --topic test

Running the proxy

Take the same parameters as the spotify/kafka image with some new ones:

  • CONSUMER_THREADS - the number of threads to consume the source kafka 7 with
  • TOPICS - whitelist of topics to mirror
  • ZK_CONNECT - the zookeeper connect string of the source kafka 7
  • GROUP_ID - the group.id to use when consuming from kafka 7
docker run -p 2181:2181 -p 9092:9092 \
    --env ADVERTISED_HOST=`boot2docker ip` \
    --env ADVERTISED_PORT=9092 \
    --env CONSUMER_THREADS=1 \
    --env TOPICS=my-topic,some-other-topic \
    --env ZK_CONNECT=kafka7zookeeper:2181/root/path \
    --env GROUP_ID=mymirror \
    spotify/kafkaproxy

In the box

  • spotify/kafka

    The docker image with both Kafka and Zookeeper. Built from the kafka
    directory.

  • spotify/kafkaproxy

    The docker image with Kafka, Zookeeper and a Kafka 7 proxy that can be
    configured with a set of topics to mirror.

Public Builds

https://registry.hub.docker.com/u/spotify/kafka/

https://registry.hub.docker.com/u/spotify/kafkaproxy/

Build from Source

docker build -t spotify/kafka kafka/
docker build -t spotify/kafkaproxy kafkaproxy/

Todo

  • Not particularily optimzed for startup time.
  • Better docs

主要指標

概覽
名稱與所有者spotify/docker-kafka
主編程語言Shell
編程語言Shell (語言數: 1)
平台
許可證Apache License 2.0
所有者活动
創建於2014-10-04 13:43:33
推送於2019-12-18 12:41:25
最后一次提交2016-12-08 05:52:22
發布數0
用户参与
星數1.4k
關注者數134
派生數636
提交數25
已啟用問題?
問題數44
打開的問題數32
拉請求數10
打開的拉請求數30
關閉的拉請求數20
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?