-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathdocker-compose.yml
96 lines (93 loc) · 3.02 KB
/
docker-compose.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
version: '3.2'
services:
pg01:
image: pg:${pg_version}
environment:
INITIAL_NODE_TYPE: master
NODE_ID: 1
NODE_NAME: pg01
MSLIST: "asset,ingest,playout"
# for each micro-service two db users are created, for ex. asset_owner and asset_user, etc.
MSOWNERPWDLIST: "asset_owner,ingest_owner,playout_owner"
MSUSERPWDLIST: "asset_user,ingest_user,playout_user"
REPMGRPWD: rep123
PGMASTER: pg01
REPMGRD_FAILOVER_MODE: manual
volumes:
- /u01/pg10/data:/data
- /u02/archive:/archive
- /u02/backup:/backup
- /etc/localtime:/etc/localtime
deploy:
placement:
constraints:
- node.id == {{ docker_node_1 }}
ports:
- target: 5432
published: 5432
protocol: tcp
mode: host
pg02:
image: pg:${pg_version}
environment:
INITIAL_NODE_TYPE: slave
NODE_ID: 2
NODE_NAME: pg02
MSLIST: "asset,ingest,playout"
# for each micro-service two db users are created, for ex. asset_owner and asset_user, etc.
MSOWNERPWDLIST: "asset_owner,ingest_owner,playout_owner"
MSUSERPWDLIST: "asset_user,ingest_user,playout_user"
REPMGRPWD: rep123
PGMASTER: pg01
REPMGRD_FAILOVER_MODE: manual
volumes:
- /u01/pg10/data:/data
- /u02/archive:/archive
- /u02/backup:/backup
- /etc/localtime:/etc/localtime
deploy:
placement:
constraints:
- node.id == {{ docker_node_2 }}
ports:
- target: 5432
published: 5432
protocol: tcp
mode: host
depends_on:
- pg01
pgpool:
image: pgpool:${pg_version}
ports:
- 9999:9999
environment:
PGMASTER_NODE_NAME: pg01
PG_BACKEND_NODE_LIST: 0:pg01:5432:1:/data:ALLOW_TO_FAILOVER,1:pg02:5432:1:/data:ALLOW_TO_FAILOVER
# csv list of backend postgres databases, each backend db contains (separated by :)
# number (start with 0):host name:pgpool port (default 9999):data dir (default /data):flag ALLOW_TO_FAILOVER or DISALLOW_TO_FAILOVER
# not needed when there is a single postgres DB
PGP_NODE_NAME: pgpool
REPMGRPWD: rep123
FAILOVER_MODE: automatic
PGPOOL_HEALTH_CHECK_MAX_RETRIES: 6
PGPOOL_HEALTH_CHECK_RETRY_DELAY: 5
#DELEGATE_IP: 172.18.0.100
#TRUSTED_SERVERS: 172.23.1.250
#PGP_HEARTBEATS: "0:pgpool01:9694,1:pgpool02:9694"
#PGP_OTHERS: "0:pgpool02:9999"
# csv list of other pgpool nodes, each node contains (separated by :)
# number (start with 0):host name:pgpool port (default 9999)
# not needed when there is a single pgpool node
depends_on:
- pg01
- pg02
manager:
image: manager:${manager_version}
ports:
- 8080:8080
environment:
PG_BACKEND_NODE_LIST: 0:pg01:5432:1:/data:ALLOW_TO_FAILOVER,1:pg02:5432:1:/data:ALLOW_TO_FAILOVER
REPMGRPWD: rep123
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: always