-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose-cluster.yml
39 lines (35 loc) · 1.3 KB
/
docker-compose-cluster.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
version: '3.8'
# 伪集群方式配置时,各服务对外暴露的端口在映射到主机时,需要使用不同的端口,否则会导致端口冲突
# Docker-Compose 方式启动容器集群的 YAML 配置文件
# 当前配置仅保证可以启动容器;更多配置参数请参考镜像 README.md 文档中说明
services:
zoo1:
image: registry.cn-shenzhen.aliyuncs.com/colovu/zookeeper:3.6
restart: always
ports:
- 2181:2181
environment:
- ZOO_SERVER_ID=1
- ALLOW_ANONYMOUS_LOGIN=yes
- ZOO_LISTEN_ALLIPS_ENABLED=yes
- ZOO_SERVERS=server.1=0.0.0.0:2888:3888,server.2=zoo2:2888:3888,server.3=zoo3:2888:3888
zoo2:
image: registry.cn-shenzhen.aliyuncs.com/colovu/zookeeper:3.6
restart: always
ports:
- 2182:2181
environment:
- ZOO_SERVER_ID=2
- ALLOW_ANONYMOUS_LOGIN=yes
- ZOO_LISTEN_ALLIPS_ENABLED=yes
- ZOO_SERVERS=server.1=zoo1:2888:3888,server.2=0.0.0.0:2888:3888,server.3=zoo3:2888:3888
zoo3:
image: registry.cn-shenzhen.aliyuncs.com/colovu/zookeeper:3.6
restart: always
ports:
- 2183:2181
environment:
- ZOO_SERVER_ID=3
- ALLOW_ANONYMOUS_LOGIN=yes
- ZOO_LISTEN_ALLIPS_ENABLED=yes
- ZOO_SERVERS=server.1=zoo1:2888:3888,server.2=zoo2:2888:3888,server.3=0.0.0.0:2888:3888