Dockerized Apache Kafka Connect (distributed mode)
0.10.0.0 (2.11) (0.10.0.0/Dockerfile)0.10.1.1 (2.11) (0.10.1.1/Dockerfile)0.10.2.0 (2.12) (0.10.2.0/Dockerfile)Write docker-compose.yml like and then execute docker-compose up
version: '2'
services:
zk:
image: 31z4/zookeeper:3.4.8
kafka:
image: ches/kafka
links:
- zk
environment:
KAFKA_BROKER_ID: 0
KAFKA_ADVERTISED_HOST_NAME: kafka
KAFKA_ADVERTISED_PORT: 9092
ZOOKEEPER_CONNECTION_STRING: zk:2181
ZOOKEEPER_CHROOT: /broker-0
connect:
image: 1ambda/kafka-connect
links:
- kafka
ports:
- "8083:8083"
environment:
CONNECT_BOOTSTRAP_SERVERS: kafka:9092
CONNECT_GROUP_ID: connect-cluster-A
$ docker run -d --name zk 31z4/zookeeper:3.4.8
$ docker run -d --name kafka \
-e KAFKA_BROKER_ID=0 \
-e KAFKA_ADVERTISED_PORT=9092 \
-e ZOOKEEPER_CONNECTION_STRING=zk:2181 \
--link zk:zk ches/kafka
$ docker run --rm --name connect \
-p 8083:8083 \
-e CONNECT_BOOTSTRAP_SERVERS=kafka:9092 \
-e CONNECT_GROUP_ID=connect-cluster-A \
--link kafka:kafka 1ambda/kafka-connect
Pass env variables starting with CONNECT_ to configure connect-distributed.properties.
For example, If you want to set offset.flush.interval.ms=15000, use CONNECT_OFFSET_FLUSH_INTERVAL_MS=15000
CONNECT_BOOTSTRAP_SERVERSCONNECT_GROUP_ID (default value: connect-cluster)CONNECT_REST_ADVERTISED_HOST_NAMECONNECT_REST_ADVERTISED_PORTOther connect configuration fields are optional. (see also Kafka Connect Configs)
If you want to run additional connectors, add connector JARs to ${KAFKA_HOME}/connectors in container.
FROM 1ambda/kafka-connect:latest
# same as `cp -R connectors/ $KAFKA_HOME/`
# the entrypoint will extends `$CLASSPATH`
# like `export CLASSPATH=${CLASSPATH}:${KAFKA_HOME}/connectors/*`
COPY connectors $KAFKA_HOME/connectors
2.110.10.0.0/opt/kafka_${SCALA_VERSION}-${KAFKA_VERSION}${KAFKA_HOME}/config/connect-distributed.properties${KAFKA_HOME}/bin/connect-distributed.sh8083 (exposed)9999 (exposed)Apache 2.0
Content type
Image
Digest
Size
92.1 MB
Last updated
over 9 years ago
docker pull 1ambda/kafka-connect