-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpatroni.yml.j2
More file actions
83 lines (71 loc) · 1.96 KB
/
patroni.yml.j2
File metadata and controls
83 lines (71 loc) · 1.96 KB
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
scope: patroni_cls
namespace: /var/lib/pgsql/config/
name: {{ container_prefix }}{{ item }}
restapi:
listen: 0.0.0.0:8008
connect_address: "{{ container_prefix }}{{ item }}:8008"
etcd3:
host: "{{ container_prefix }}1:2379"
bootstrap:
dcs:
ttl: 30
loop_wait: 10
retry_timeout: 10
maximum_lag_on_failover: 1048576
postgresql:
use_pg_rewind: true
use_slots: true
parameters:
shared_preload_libraries: 'pg_stat_monitor'
wal_level: replica
hot_standby: "on"
wal_keep_size: 128MB
max_wal_senders: 10
max_replication_slots: 10
wal_log_hints: "on"
archive_mode: "on"
archive_timeout: 600s
archive_command: pgbackrest --stanza=patroni_backup --log-level-console=info archive-push /var/lib/postgresql/{{ pdpgsql_version }}/main/pg_wal/%f
pg_hba:
- host replication replicator 127.0.0.1/32 md5
- host replication replicator 172.18.0.0/16 md5
- host all all 0.0.0.0/0 md5
- local all postgres trust
initdb:
- encoding: UTF8
- data-checksums
- waldir: /pg_wal
- wal-segsize=512
users:
admin:
password: admin
options:
- createrole
- createdb
postgresql:
listen: 0.0.0.0:5432
connect_address: "{{ container_prefix }}{{ item }}:5432"
data_dir: /var/lib/postgresql/{{ pdpgsql_version }}/main
bin_dir: /usr/lib/postgresql/{{ pdpgsql_version }}/bin
pgpass: /tmp/pgpass
authentication:
replication:
username: replicator
password: replPasswd
superuser:
username: postgres
password: pass+this
create_replica_methods:
- pgbackrest
- basebackup
pgbackrest:
command: pgbackrest --stanza=patroni_backup restore --pg1-path=/var/lib/postgresql/{{ pdpgsql_version }}/main --type=none
keep_data: true
no_params: true
basebackup:
checkpoint: fast
tags:
nofailover: false
noloadbalance: false
clonefrom: false
nosync: false