2018-11-05 08:49:40 +01:00
|
|
|
scope: "@VERSION@-@CLUSTER@"
|
|
|
|
namespace: "/postgresql-common/"
|
|
|
|
name: @HOSTNAME@
|
|
|
|
|
2019-01-21 14:42:21 +01:00
|
|
|
@DCS_CONFIG@
|
2018-11-05 08:49:40 +01:00
|
|
|
|
|
|
|
restapi:
|
2019-02-04 14:52:12 +01:00
|
|
|
listen: @HOSTIP@:@API_PORT@
|
|
|
|
connect_address: @HOSTIP@:@API_PORT@
|
2018-11-05 08:49:40 +01:00
|
|
|
# certfile: /etc/ssl/certs/ssl-cert-snakeoil.pem
|
|
|
|
# keyfile: /etc/ssl/private/ssl-cert-snakeoil.key
|
|
|
|
# authentication:
|
|
|
|
# username: username
|
|
|
|
# password: password
|
|
|
|
|
|
|
|
# ctl:
|
|
|
|
# insecure: false # Allow connections to SSL sites without certs
|
|
|
|
# certfile: /etc/ssl/certs/ssl-cert-snakeoil.pem
|
|
|
|
# cacert: /etc/ssl/certs/ssl-cacert-snakeoil.pem
|
|
|
|
|
|
|
|
bootstrap:
|
|
|
|
# Custom bootstrap method
|
|
|
|
method: pg_createcluster
|
|
|
|
pg_createcluster:
|
|
|
|
command: /usr/share/patroni/pg_createcluster_patroni
|
|
|
|
|
|
|
|
# this section will be written into Etcd:/<namespace>/<scope>/config after initializing new cluster
|
|
|
|
# and all other cluster members will use it as a `global configuration`
|
|
|
|
dcs:
|
|
|
|
ttl: 30
|
|
|
|
loop_wait: 10
|
|
|
|
retry_timeout: 10
|
|
|
|
maximum_lag_on_failover: 1048576
|
|
|
|
# master_start_timeout: 300
|
|
|
|
# synchronous_mode: false
|
|
|
|
# standby_cluster:
|
|
|
|
# host: 127.0.0.1
|
|
|
|
# port: 1111
|
|
|
|
# primary_slot_name: patroni
|
|
|
|
postgresql:
|
2019-01-27 14:18:37 +01:00
|
|
|
use_pg_rewind: false
|
|
|
|
remove_data_directory_on_diverged_timelines: true
|
2018-11-05 08:49:40 +01:00
|
|
|
# use_slots: true
|
2019-01-30 15:08:39 +01:00
|
|
|
# The following parameters are given as command line options
|
|
|
|
# overriding the settings in postgresql.conf.
|
2018-11-05 08:49:40 +01:00
|
|
|
parameters:
|
|
|
|
# wal_level: hot_standby
|
|
|
|
# hot_standby: "on"
|
|
|
|
# wal_keep_segments: 8
|
|
|
|
# max_wal_senders: 10
|
|
|
|
# max_replication_slots: 10
|
2019-01-30 15:13:22 +01:00
|
|
|
# max_worker_processes = 8
|
2018-11-05 08:49:40 +01:00
|
|
|
# wal_log_hints: "on"
|
2019-01-30 15:13:22 +01:00
|
|
|
# track_commit_timestamp = "off"
|
2018-11-05 08:49:40 +01:00
|
|
|
# recovery_conf:
|
|
|
|
# restore_command: cp ../wal_archive/%f %p
|
2019-01-30 12:55:32 +01:00
|
|
|
# Set pg_hba.conf to the following values after bootstrapping or cloning.
|
|
|
|
# If you want to allow regular connections from the local network, or
|
|
|
|
# want to use pg_rewind, you need to uncomment the fourth entry.
|
2019-01-28 15:58:01 +01:00
|
|
|
pg_hba:
|
|
|
|
- local all all peer
|
|
|
|
- host all all 127.0.0.1/32 md5
|
|
|
|
- host all all ::1/128 md5
|
2019-01-30 12:55:32 +01:00
|
|
|
# - host all all @NETWORK@ md5
|
2019-01-28 15:58:01 +01:00
|
|
|
- local replication all peer
|
|
|
|
- host replication all 127.0.0.1/32 md5
|
|
|
|
- host replication all ::1/128 md5
|
|
|
|
- host replication all @NETWORK@ md5
|
2018-11-05 08:49:40 +01:00
|
|
|
|
|
|
|
postgresql:
|
|
|
|
# Custom clone method
|
|
|
|
create_replica_method:
|
|
|
|
- pg_clonecluster
|
|
|
|
pg_clonecluster:
|
|
|
|
command: /usr/share/patroni/pg_clonecluster_patroni
|
|
|
|
|
2019-01-28 14:19:41 +01:00
|
|
|
listen: "@HOSTIP@,127.0.0.1:@PORT@"
|
2019-01-15 16:40:27 +01:00
|
|
|
connect_address: @HOSTIP@:@PORT@
|
2019-01-14 21:01:56 +01:00
|
|
|
use_unix_socket: true
|
2018-11-05 08:49:40 +01:00
|
|
|
data_dir: /var/lib/postgresql/@VERSION@/@CLUSTER@
|
|
|
|
bin_dir: /usr/lib/postgresql/@VERSION@/bin
|
|
|
|
config_dir: /etc/postgresql/@VERSION@/@CLUSTER@
|
2019-01-30 14:58:28 +01:00
|
|
|
pgpass: /var/lib/postgresql/@VERSION@-@CLUSTER@.pgpass
|
2018-11-05 08:49:40 +01:00
|
|
|
authentication:
|
|
|
|
replication:
|
|
|
|
username: replicator
|
|
|
|
password: rep-pass
|
2019-01-14 21:01:56 +01:00
|
|
|
# A superuser role is required in order for Patroni to manage the local
|
|
|
|
# Postgres instance. If the option `use_unix_socket' is set to `true', then
|
|
|
|
# specifying an empty password results in no md5 password for the superuser
|
|
|
|
# being set and sockets being used for authentication. The `password:' line is
|
|
|
|
# nevertheless required. Note that pg_rewind will not work if no md5 password
|
|
|
|
# is set.
|
|
|
|
superuser:
|
|
|
|
username: postgres
|
|
|
|
password:
|
2018-11-05 08:49:40 +01:00
|
|
|
parameters:
|
|
|
|
unix_socket_directories: '/var/run/postgresql/'
|
|
|
|
# Emulate default Debian/Ubuntu logging
|
|
|
|
logging_collector: 'on'
|
|
|
|
log_directory: '/var/log/postgresql'
|
|
|
|
log_filename: 'postgresql-@VERSION@-@CLUSTER@.log'
|