9f5c5c6af1
- Set use_pg_rewind, use_slots and check_timeline to true. - Update comments and formatting.
141 lines
5.3 KiB
YAML
141 lines
5.3 KiB
YAML
scope: "@VERSION@-@CLUSTER@"
|
|
namespace: "/postgresql-common/"
|
|
name: @HOSTNAME@
|
|
|
|
@DCS_CONFIG@
|
|
|
|
restapi:
|
|
listen: @HOSTIP@:@API_PORT@
|
|
connect_address: @HOSTIP@:@API_PORT@
|
|
# 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
|
|
# The options --scope= and --datadir= are passed to the custom script by
|
|
# patroni and passed on to pg_createcluster by pg_createcluster_patroni
|
|
method: pg_createcluster
|
|
pg_createcluster:
|
|
command: /usr/share/patroni/pg_createcluster_patroni
|
|
|
|
# This section will be written into /<namespace>/<scope>/config after
|
|
# initializing a 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
|
|
check_timeline: true
|
|
# master_start_timeout: 300
|
|
# synchronous_mode: false
|
|
# standby_cluster:
|
|
# host: 127.0.0.1
|
|
# port: 1111
|
|
# primary_slot_name: patroni
|
|
postgresql:
|
|
use_pg_rewind: true
|
|
remove_data_directory_on_rewind_failure: true
|
|
remove_data_directory_on_diverged_timelines: true
|
|
use_slots: true
|
|
# The following parameters are given as command line options
|
|
# overriding the settings in postgresql.conf.
|
|
parameters:
|
|
# wal_level: hot_standby
|
|
# hot_standby: "on"
|
|
# wal_keep_segments: 8
|
|
# max_wal_senders: 10
|
|
# max_replication_slots: 10
|
|
# max_worker_processes = 8
|
|
# wal_log_hints: "on"
|
|
# track_commit_timestamp = "off"
|
|
# recovery_conf:
|
|
# restore_command: cp ../wal_archive/%f %p
|
|
# 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.
|
|
pg_hba:
|
|
- local all all peer
|
|
- host all all 127.0.0.1/32 md5
|
|
- host all all ::1/128 md5
|
|
# - host all all @NETWORK@ md5
|
|
- local replication all peer
|
|
- host replication all 127.0.0.1/32 md5
|
|
- host replication all ::1/128 md5
|
|
- host replication all @NETWORK@ md5
|
|
# # Some possibly desired options for 'initdb'. Note: It needs to be a list
|
|
# # (some options need values, others are # switches)
|
|
# initdb:
|
|
# - encoding: UTF8
|
|
# - data-checksums
|
|
|
|
# # Additional script to be launched after initial cluster creation (will be
|
|
# # passed the connection URL as parameter)
|
|
# post_init: /usr/local/bin/setup_cluster.sh
|
|
|
|
# # Additional users to be created after initializing the cluster
|
|
# users:
|
|
# foo:
|
|
# password: bar
|
|
# options:
|
|
# - createrole
|
|
# - createdb
|
|
|
|
postgresql:
|
|
# Custom clone method
|
|
# The options --scope= and --datadir= are passed to the custom script by
|
|
# patroni and passed on to pg_createcluster by pg_clonecluster_patroni
|
|
create_replica_method:
|
|
- pg_clonecluster
|
|
pg_clonecluster:
|
|
command: /usr/share/patroni/pg_clonecluster_patroni
|
|
|
|
# Listen to all interfaces by default, this makes vip-manager work
|
|
# out-of-the-box without having to set net.ipv4.ip_nonlocal_bind or similar.
|
|
# If you prefer to only listen on some interfaces, edit the below:
|
|
# listen: "@HOSTIP@@LISTEN_VIP@,127.0.0.1:@PORT@"
|
|
listen: "*:@PORT@"
|
|
connect_address: @HOSTIP@:@PORT@
|
|
use_unix_socket: true
|
|
# Default Debian/Ubuntu directory layout
|
|
data_dir: @DATADIR_BASE@/@VERSION@/@CLUSTER@
|
|
bin_dir: /usr/lib/postgresql/@VERSION@/bin
|
|
config_dir: /etc/postgresql/@VERSION@/@CLUSTER@
|
|
pgpass: /var/lib/postgresql/@VERSION@-@CLUSTER@.pgpass
|
|
authentication:
|
|
replication:
|
|
username: "replicator"
|
|
password: "rep-pass"
|
|
# 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 unless a rewind user is configured, see
|
|
# below.
|
|
superuser:
|
|
username: "postgres"
|
|
password:
|
|
# A rewind role can be specified in order for Patroni to use on PostgreSQL
|
|
# 11 or later for pg_rewind, i.e. rewinding a former primary after failover
|
|
# without having to re-clone it. Patroni will assign this user the
|
|
# necessary permissions (that only exist from PostgreSQL)
|
|
# rewind:
|
|
# username: "rewind"
|
|
# password: "rewind-pass"
|
|
|
|
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'
|