File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Shared base configuration for Postgres nodes. Avoids duplication and keeps all nodes consistent.
2+ # Note: This is a template, not a service.
3+ x-node : &node
4+ image : citusdata/pg_auto_failover:v2.0-pg14
5+ volumes :
6+ - /var/lib/postgres
7+ environment :
8+ PGDATA : /var/lib/postgres/pgaf
9+ PGUSER : tutorial
10+ PGDATABASE : tutorial
11+ PG_AUTOCTL_HBA_LAN : true
12+ PG_AUTOCTL_AUTH_METHOD : " trust"
13+ PG_AUTOCTL_SSL_SELF_SIGNED : true
14+ PG_AUTOCTL_MONITOR : " postgresql://autoctl_node@monitor/pg_auto_failover"
15+ expose :
16+ - 5432
17+
118volumes :
219 postgres_data :
320
@@ -31,3 +48,39 @@ services:
3148 - 8090:8080
3249 networks :
3350 - aligned-network
51+
52+ monitor :
53+ image : citusdata/pg_auto_failover:v2.0-pg14
54+ volumes :
55+ - /var/lib/postgres
56+ environment :
57+ PGDATA : /var/lib/postgres/pgaf
58+ PG_AUTOCTL_SSL_SELF_SIGNED : true
59+ ports :
60+ - " 5436:5432"
61+ command : |
62+ pg_autoctl create monitor --auth trust --run
63+
64+ node1 :
65+ << : *node
66+ hostname : node1
67+ command : >
68+ pg_autoctl create postgres
69+ --name node1
70+ --ssl-self-signed
71+ --ssl-mode require
72+ --auth trust
73+ --pg-hba-lan
74+ --run
75+
76+ node2 :
77+ << : *node
78+ hostname : node2
79+ command : >
80+ pg_autoctl create postgres
81+ --name node2
82+ --ssl-self-signed
83+ --ssl-mode require
84+ --auth trust
85+ --pg-hba-lan
86+ --run
You can’t perform that action at this time.
0 commit comments