This repository has been archived by the owner on Jan 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose-ha.yml
175 lines (175 loc) · 5.02 KB
/
docker-compose-ha.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
version: '3'
networks:
cluster:
driver: bridge
services:
nfs:
image: joebiellik/nfs4
container_name: nfs_hipchat
privileged: true
ports:
- "2049:2049/tcp"
- "2049:2049/udp"
- "111:111/tcp"
- "111:111/udp"
volumes:
- $HOME/dockerdata/nfs_hipchat/nfs-export-cfg:/etc/exports
- $HOME/dockerdata/nfs_hipchat/:/mnt
rdsmaster:
image: redis:3.2
container_name: rdsmaster
ports:
- "6379:6379"
volumes:
- $HOME/dockerdata/rds_hipchat:/data
rdsslave1:
image: redis:3.2
container_name: rdsslave1
command: redis-server --slaveof rdsmaster 6379
links:
- rdsmaster
rdsslave2:
image: redis:3.2
container_name: rdsslave2
command: redis-server --slaveof rdsmaster 6379
links:
- rdsmaster
sentinal:
build: sentinal
container_name: rdssentinal
environment:
- SENTINAL_DOWN_AFTER=5
- SENTINAL_FAILOVER=5
- MASTER_HOST=rdsmaster
- SENTINEL_QUORUM=1
ports:
- "9000:26379"
links:
- rdsmaster
- rdsslave1
- rdsslave2
pgmasterhipchat:
build:
context: ./pgsql
dockerfile: Postgres-9.5.Dockerfile
container_name: pgmaster
environment:
- PARTNER_NODES=pgslave1,pgslave2
- NODE_ID=1
- NODE_NAME=node1
- CLUSTER_NODE_NETWORK_NAME=pgmaster
- NODE_PRIORITY=100
- SSH_ENABLE=1
- POSTGRES_PASSWORD=hipchat
- POSTGRES_DB=hipchat
- POSTGRES_USER=hipchat
- CLEAN_OVER_REWIND=0
- CONFIGS=max_replication_slots:15,max_connections:1000
- CLUSTER_NAME=pg_cluster
- REPLICATION_DB=replication_db
- REPLICATION_USER=replication_user
- REPLICATION_PASSWORD=replication_pass
ports:
- "5432:5432"
volumes:
- $HOME/dockerdata/pgmaster:/var/lib/postgresql/data
networks:
cluster:
aliases:
- pgmaster
pgslave1_hipchat:
build:
context: ./pgsql
dockerfile: Postgres-9.5.Dockerfile
container_name: pgslave1_hipchat
environment:
- PARTNER_NODES=pgmaster,pgslave2
- REPLICATION_PRIMARY_HOST=pgmaster
- NODE_ID=2
- NODE_NAME=node2
- CLUSTER_NODE_NETWORK_NAME=pgslave1
- CLEAN_OVER_REWIND=1
- CONFIGS=max_replication_slots:10
ports:
- "5441:5432"
networks:
cluster:
aliases:
- pgslave1
pgslave2_hipchat:
build:
context: ./pgsql
dockerfile: Postgres-9.5.Dockerfile
container_name: pgslave2_hipchat
environment:
- PARTNER_NODES=pgmaster,pgslave1
- REPLICATION_PRIMARY_HOST=pgmaster
- NODE_ID=3
- NODE_NAME=node3
- CLUSTER_NODE_NETWORK_NAME=pgslave2
- CLEAN_OVER_REWIND=1
- CONFIGS=max_replication_slots:10
ports:
- "5442:5432"
networks:
cluster:
aliases:
- pgslave2
pgpool1_hipchat:
build:
context: ./pgsql
dockerfile: Pgpool-latest.Dockerfile
container_name: pgpool1_hipchat
environment:
- PCP_USER=pcp_user
- PCP_PASSWORD=pcp_pass
- WAIT_BACKEND_TIMEOUT=20
- CHECK_USER=replication_user
- CHECK_PASSWORD=replication_pass
- CHECK_PGCONNECT_TIMEOUT=5
- SSH_ENABLE=1
- DB_USERS=replication_user:replication_pass
- BACKENDS=0:pgmaster:5432:1:/var/lib/postgresql/data:ALLOW_TO_FAILOVER,1:pgslave1:5432:1:/var/lib/postgresql/data:ALLOW_TO_FAILOVER,2:pgslave2:5432:2:/var/lib/postresql/data:ALLOW_TO_FAILOVER
- REQUIRE_MIN_BACKENDS=1
- CONFIGS=num_init_children:250,max_pool:15,use_watchdog:on,other_pgpool_hostname1:pgpool2,other_pgpool_port1:5432,other_wd_port1:9006,wd_port:9005,wd_hostname:pgpool1,wd_heartbeat_port:9694,heartbeat_destination0:pgpool2,enable_pool_hba:on,pool_passwd:pool_passwd
ports:
- "5430:5432"
- "9898:9898"
- "9005:9005"
- "9694:9694"
networks:
cluster:
aliases:
- pgpool1
pgpool2_hipchat:
build:
context: ./pgsql
dockerfile: Pgpool-latest.Dockerfile
container_name: pgpool2_hipchat
environment:
- PCP_USER=pcp_user
- PCP_PASSWORD=pcp_pass
- WAIT_BACKEND_TIMEOUT=20
- CHECK_USER=replication_user
- CHECK_PASSWORD=replication_pass
- CHECK_PGCONNECT_TIMEOUT=5
- SSH_ENABLE=1
- DB_USERS=replication_user:replication_pass
- BACKENDS=0:pgmaster:5432:1:/var/lib/postgresql/data:ALLOW_TO_FAILOVER,1:pgslave1:5432:1:/var/lib/postgresql/data:ALLOW_TO_FAILOVER,2:pgslave2:5432:2:/var/lib/postresql/data:ALLOW_TO_FAILOVER
- REQUIRE_MIN_BACKENDS=1
- CONFIGS=num_init_children:250,max_pool:15,use_watchdog:on,other_pgpool_hostname1:pgpool1,other_pgpool_port1:5432,other_wd_port1:9005,wd_port:9006,wd_hostname:pgpool2,wd_heartbeat_port:9695,heartbeat_destination0:pgpool1,enable_pool_hba:on
ports:
- "5431:5432"
- "9899:9898"
- "9006:9006"
- "9695:9695"
networks:
cluster:
aliases:
- pgpool2
haproxy:
image: haproxy_dev
container_name: ha_hipchat
ports:
- "1936:1936"
- "443:443"