Now that etcd has been configured and watchdog/softdog has been enabled, we are done with all the prerequisites required for configuring Patroni for high availability and automatic failover. Patroni's setup entirely depends on its configuration file. Once the configuration file is in place, it is just a matter of bootstrapping a PostgreSQL node (primary) using Partroni and adding more nodes to the Patroni cluster to complete the HA setup. In this recipe, we shall discuss how to build the Patroni configuration file correctly.
Getting ready...
There are some PostgreSQL parameters that must be same across the master and the standby/replica servers. Setting such values in the local configuration file has no effect. The following is a list of those parameters and their default values:
max_connections: 100
max_locks_per_transaction: 64
max_worker_processes: 8
max_prepared_transactions: 0
wal_level: hot_standby
wal_log_hints: on
track_commit_timestamp...