File tree 2 files changed +22
-4
lines changed
2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -59,10 +59,20 @@ bootstrap:
59
59
synchronous_mode: {{ synchronous_mode |string |d(false, true) |lower }}
60
60
synchronous_mode_strict: {{ synchronous_mode_strict |string |d(false, true) |lower }}
61
61
synchronous_node_count: {{ synchronous_node_count |d(1, true) |int }}
62
- # standby_cluster:
63
- # host: 127.0.0.1
64
- # port: 1111
65
- # primary_slot_name: patroni
62
+ {% if patroni_standby_cluster .host is defined and patroni_standby_cluster .host | length > 0 %}
63
+ standby_cluster:
64
+ host: {{ patroni_standby_cluster.host }}
65
+ port: {{ patroni_standby_cluster.port }}
66
+ {% if patroni_standby_cluster .primary_slot_name is defined and patroni_standby_cluster .primary_slot_name | length > 0 %}
67
+ primary_slot_name: {{ patroni_standby_cluster.primary_slot_name }}
68
+ {% endif %}
69
+ {% if patroni_standby_cluster .restore_command is defined and patroni_standby_cluster .restore_command | length > 0 %}
70
+ restore_command: {{ patroni_standby_cluster.restore_command }}
71
+ {% endif %}
72
+ {% if patroni_standby_cluster .recovery_min_apply_delay is defined and patroni_standby_cluster .recovery_min_apply_delay | length > 0 %}
73
+ recovery_min_apply_delay: {{ patroni_standby_cluster.recovery_min_apply_delay }}
74
+ {% endif %}
75
+ {% endif %}
66
76
postgresql:
67
77
use_pg_rewind: {{ patroni_postgresql_use_pg_rewind |string |d(false, true) |lower }}
68
78
use_slots: true
Original file line number Diff line number Diff line change @@ -218,6 +218,14 @@ patroni_retry_timeout: 10
218
218
patroni_maximum_lag_on_failover : 1048576
219
219
patroni_master_start_timeout : 300
220
220
221
+ # https://patroni.readthedocs.io/en/latest/replica_bootstrap.html#standby-cluster
222
+ patroni_standby_cluster :
223
+ host : " " # an address of remote master
224
+ port : " 5432" # a port of remote master
225
+ # primary_slot_name: "" # which slot on the remote master to use for replication (optional)
226
+ # restore_command: "" # command to restore WAL records from the remote master to standby leader (optional)
227
+ # recovery_min_apply_delay: "" # how long to wait before actually apply WAL records on a standby leader (optional)
228
+
221
229
patroni_log_destination : stderr # or 'logfile'
222
230
# if patroni_log_destination: logfile
223
231
patroni_log_dir : /var/log/patroni
You can’t perform that action at this time.
0 commit comments