| ########################################################################################### |
| # Deploy a Zookeeper/Kafka messaging cluster |
| # It is meant to be deployed within a swarm cluster using the docker stack functionality. |
| # This file will deploy 3 zookeeper containers and 1 kafka container per swarm node. |
| # This file will also create an overlay network which can be referred by other services. |
| # docker stack deploy -c docker-compose-kafka-ha-cluster.yml kafka |
| ########################################################################################### |
| image: "${REGISTRY}wurstmeister/zookeeper:${ZK_TAG:-latest}" |
| ZOO_SERVERS: server.1=0.0.0.0:2888:3888 server.2=zk2:2888:3888 server.3=zk3:2888:3888 |
| image: "${REGISTRY}wurstmeister/zookeeper:${ZK_TAG:-latest}" |
| ZOO_SERVERS: server.1=zk1:2888:3888 server.2=0.0.0.0:2888:3888 server.3=zk3:2888:3888 |
| image: "${REGISTRY}wurstmeister/zookeeper:${ZK_TAG:-latest}" |
| ZOO_SERVERS: server.1=zk1:2888:3888 server.2=zk2:2888:3888 server.3=0.0.0.0:2888:3888 |
| image: "${REGISTRY}wurstmeister/kafka:${KAFKA_TAG:-latest}" |
| KAFKA_LISTENERS: PLAINTEXT://:9092 |
| KAFKA_ZOOKEEPER_CONNECT: zk1:2181,zk2:2181,zk3:2181 |
| KAFKA_HEAP_OPTS: -Xmx256M -Xms128M |
| - /var/run/docker.sock:/var/run/docker.sock |