-
Notifications
You must be signed in to change notification settings - Fork 0
/
patroni01.yml
118 lines (108 loc) · 3.69 KB
/
patroni01.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
scope: clustertest
namespace: /nsclustertest
name: pg01
log:
level: INFO
dir: /var/log/patroni
file_size: 10485760 # 10MB
restapi:
listen: 172.28.33.11:8008
connect_address: 172.28.33.11:8008
consul:
host: 172.28.33.13:8500
bootstrap:
dcs:
ttl: 30
loop_wait: 10
retry_timeout: 10
maximum_lag_on_failover: 1048576 # 1MB
master_start_timeout: 300
postgresql:
use_pg_rewind: true
parameters:
archive_command: 'exit 0'
archive_mode: 'on'
autovacuum: 'on'
checkpoint_completion_target: 0.6
#checkpoint_segments: 10
checkpoint_warning: 300
#data_directory: '/var/lib/postgresql/patroni'
datestyle: 'iso, mdy'
default_text_search_config: 'pg_catalog.english'
effective_cache_size: '128MB'
#external_pid_file: '/var/run/postgresql/postgresql-main.pid'
#hba_file: '/var/lib/postgresql/patroni/pg_hba.conf'
hot_standby: 'on'
#ident_file: '/var/lib/postgresql/patroni/pg_ident.conf'
include_if_exists: 'repmgr_lib.conf'
lc_messages: 'C'
listen_addresses: '*'
log_autovacuum_min_duration: 0
log_checkpoints: 'on'
logging_collector: 'on'
log_min_messages: INFO
log_filename: 'postgresql.log'
log_connections: 'on'
log_directory: '/var/log/postgresql'
log_disconnections: 'on'
log_line_prefix: '%t [%p]: [%l-1] user=%u,db=%d,app=%a '
log_lock_waits: 'on'
log_min_duration_statement: 0
log_temp_files: 0
maintenance_work_mem: '128MB'
max_connections: 101
max_wal_senders: 5
port: 5432
shared_buffers: '128MB'
shared_preload_libraries: 'pg_stat_statements'
#ssl: on
#ssl_cert_file: '/etc/ssl/certs/ssl-cert-snakeoil.pem'
#ssl_key_file: '/etc/ssl/private/ssl-cert-snakeoil.key'
unix_socket_directories: '/var/run/postgresql'
wal_buffers: '8MB'
wal_keep_segments: '200'
wal_level: 'replica'
work_mem: '128MB'
initdb:
- encoding: UTF8
- data-checksums
pg_hba:
- host replication replicator 127.0.0.1/32 md5
- host replication replicator 172.28.33.11/0 md5
- host replication replicator 172.28.33.12/0 md5
- host all postgres 172.28.33.11/32 trust
- host all postgres 172.28.33.12/32 trust
- host all postgres 172.28.33.13/32 trust
- host all all 0.0.0.0/0 md5
- local all all peer
users:
admin:
password: admin
options:
- createrole
- createdb
postgresql:
listen: 127.0.0.1,172.28.33.11:5432
connect_address: 172.28.33.11:5432
data_dir: /var/lib/postgresql/patroni
pgpass: /tmp/pgpass
# create_replica_methods: [] # supports: pg_basebackup, WAL-E, pgBackRest, Barman
use_unix_socket: true
authentication:
replication:
username: replicator
password: rep-pass
superuser:
username: postgres
password: secretpassword
# custom_conf: '/etc/postgresql/9.6/main/postgresql.custom.conf'
parameters:
unix_socket_directories: '/var/run/postgresql'
wal_compression: on
tags:
nofailover: false
noloadbalance: false
clonefrom: false
nosync: false
watchdog:
mode: off