forked from saule1508/pgcluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-test.yml
126 lines (123 loc) · 3.89 KB
/
docker-compose-test.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
version: '3.2'
services:
pg01:
image: pg:${pg_version:-latest}
environment:
INITIAL_NODE_TYPE: master
NODE_ID: 1
NODE_NAME: pg01
MSLIST: "myservice"
# for each micro-service two db users are created, for ex. asset_owner and asset_user, etc.
MSOWNERPWDLIST: "myservice_owner"
MSUSERPWDLIST: "myservice_user"
REPMGRPWD: rep123
REPMGRD_FAILOVER_MODE: manual
PGMASTER: pg01
ports:
- 15432:5432 # postgres port
volumes:
- pg01db:/u01/pg10/data
- pg01arc:/u02/archive
networks:
- pgcluster_network
pg02:
image: pg:${pg_version:-latest}
environment:
INITIAL_NODE_TYPE: slave
NODE_ID: 2
NODE_NAME: pg02
MSLIST: "myservice"
# for each micro-service two db users are created, for ex. asset_owner and asset_user, etc.
MSOWNERPWDLIST: "myservice_owner"
MSUSERPWDLIST: "myservice_user"
REPMGRPWD: rep123
REPMGRD_FAILOVER_MODE: manual
PGMASTER: pg01
ports:
- 25432:5432 # postgres port
volumes:
- pg02db:/u01/pg10/data
- pg02arc:/u02/archive
networks:
- pgcluster_network
depends_on:
- pg01
pg03:
image: pg:${pg_version:-latest}
environment:
INITIAL_NODE_TYPE: slave
NODE_ID: 3
NODE_NAME: pg03
MSLIST: "myservice"
# for each micro-service two db users are created, for ex. asset_owner and asset_user, etc.
MSOWNERPWDLIST: "myservice_owner"
MSUSERPWDLIST: "myservice_user"
REPMGRPWD: rep123
REPMGRD_FAILOVER_MODE: manual
PGMASTER: pg01
ports:
- 35432:5432 # postgres port
volumes:
- pg03db:/u01/pg10/data
- pg03arc:/u02/archive
networks:
- pgcluster_network
depends_on:
- pg01
pgpool:
image: pgpool:${pg_version:-latest}
ports:
- 9999:9999
environment:
PGMASTER_NODE_NAME: pg01
PG_BACKEND_NODE_LIST: 0:pg01:5432:1:/u01/pg10/data:ALLOW_TO_FAILOVER,1:pg02:5432:1:/u01/pg10/data:ALLOW_TO_FAILOVER,2:pg03:5432:1:/u01/pg10/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 /u01/pg10/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: 3
PGPOOL_HEALTH_CHECK_RETRY_DELAY: 1
PGPOOL_FAILOVER_ON_BACKEND_ERROR: "off"
PGPOOL_HEALTH_CHECK_PERIOD: 5
PGPOOL_NUM_INIT_CHILDREN: 50
PGPOOL_LOAD_BALANCE_MODE: "no"
#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
#command: tail -f /etc/passwd
networks:
- pgcluster_network
depends_on:
- pg01
- pg02
- pg03
manager:
image: manager:${pg_version:-latest}
ports:
- 8080:8080
# to test the nodejs app, uncomment next line. Then once the container is running, exec into it and start node manually.
#command: tail -f /etc/passwd
environment:
PG_BACKEND_NODE_LIST: 0:pg01:5432:1:/u01/pg10/data:ALLOW_TO_FAILOVER,1:pg02:5432:1:/u01/pg10/data:ALLOW_TO_FAILOVER,2:pg03:5432:1:/u01/pg10/data:ALLOW_TO_FAILOVER
REPMGRPWD: rep123
DBHOST: pgpool
networks:
- pgcluster_network
volumes:
- /var/run/docker.sock:/var/run/docker.sock
volumes:
pg01db:
pg02db:
pg03db:
pg01arc:
pg02arc:
pg03arc:
networks:
pgcluster_network:
external: true