docker-compose-zookeeper-cluster.yml
作者:互联网
version: '3.5'
networks:
docker_net:
external: true
services:
zoo1:
image: zookeeper
restart: unless-stopped
hostname: zoo10
container_name: zoo11
ports:
- 2182:2181
environment:
ZOO_MY_ID: 1
ZOO_SERVERS: server.1=0.0.0.0:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=zoo3:2888:3888;2181
volumes:
- /www/zookeeper/zoo1/data:/data
- /www/zookeeper/zoo1/datalog:/datalog
networks:
- docker_net
zoo2:
image: zookeeper
restart: unless-stopped
hostname: zoo20
container_name: zoo22
ports:
- 2183:2181
environment:
ZOO_MY_ID: 2
ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=0.0.0.0:2888:3888;2181 server.3=zoo3:2888:3888;2181
volumes:
- /www/zookeeper/zoo2/data:/data
- /www/zookeeper/zoo2/datalog:/datalog
networks:
- docker_net
zoo3:
image: zookeeper
restart: unless-stopped
hostname: zoo30
container_name: zoo33
ports:
- 2184:2181
environment:
ZOO_MY_ID: 3
ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=0.0.0.0:2888:3888;2181
volumes:
- /www/zookeeper/zoo3/data:/data
- /www/zookeeper/zoo3/datalog:/datalog
networks:
- docker_net
标签:www,compose,0.0,2888,zookeeper,3888,cluster,2181,docker 来源: https://www.cnblogs.com/xivzhou/p/14962319.html