Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
As a way to get Zookeeper / Kafka AND Kafka Manager working together in docker compose...
version: '2'
services:
zookeeper:
hostname: zookeeper
image: wurstmeister/zookeeper
ports:
- "2181:2181"
kafka:
hostname: kafka
image: wurstmeister/kafka:0.9.0.0-1
ports:
- "9092:9092"
- "9093:9093"
links:
- zookeeper
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_HOST_NAME: ${DOCKER_KAFKA_HOST}
JMX_PORT: 9093
KAFKA_ADVERTISED_PORT: 9092
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_LOG_RETENTION_HOURS: 1
KAFKA_MESSAGE_MAX_BYTES: 10000000
KAFKA_REPLICA_FETCH_MAX_BYTES: 10000000
KAFKA_GROUP_MAX_SESSION_TIMEOUT_MS: 60000
KAFKA_NUM_PARTITIONS: 2
KAFKA_DELETE_RETENTION_MS: 1000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
kafka-manager:
hostname: kafka-manager
image: sheepkiller/kafka-manager
ports:
- "9000:9000"
links:
- zookeeper
- kafka
environment:
ZK_HOSTS: zookeeper:2181
APPLICATION_SECRET: letmein
@17twenty

This comment has been minimized.

Copy link
Owner Author

commented Sep 14, 2017

You need to also do:

export DOCKER_KAFKA_HOST=$(ipconfig getifaddr en0)

This is how to get it working on Mac!

@17twenty

This comment has been minimized.

Copy link
Owner Author

commented Nov 17, 2017

For working with postgres in a container:

docker run -e POSTGRES_USER=dev -e POSTGRES_PASSWORD=secret -p 5432:5432  postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.