Created
January 18, 2020 08:02
-
-
Save sasaken555/28c4a1e334723e1d5ff8156d728baf56 to your computer and use it in GitHub Desktop.
Docker Compose YAML for creating Apache Kafka cluster w/ Confluent Platform Docker containers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
zookeeper: | |
image: confluentinc/cp-zookeeper:5.4.0 | |
hostname: zookeeper | |
container_name: zookeeper | |
ports: | |
- "32181:32181" | |
environment: | |
ZOOKEEPER_CLIENT_PORT: 32181 | |
ZOOKEEPER_TICK_TIME: 2000 | |
broker: | |
image: confluentinc/cp-kafka:5.4.0 | |
hostname: broker | |
container_name: broker | |
depends_on: | |
- zookeeper | |
ports: | |
- "29092:29092" | |
environment: | |
KAFKA_BROKER_ID: 1 | |
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:32181" | |
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT | |
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker:9092,PLAINTEXT_HOST://localhost:29092 | |
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | |
cli: | |
image: confluentinc/cp-kafka:5.4.0 | |
hostname: cli | |
container_name: cli | |
depends_on: | |
- broker | |
entrypoint: /bin/sh | |
tty: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you want to connect brokers from local machine, use
tcp://localhost:29092
.If from
cli
container, usetcp://broker:9092
.