@@ -497,54 +497,135 @@ For instructions about how to set up Patroni on the primary node, see the
If you are currently using `repmgr` on your Geo primary, see [these instructions](#migrating-from-repmgr-to-patroni) for migrating from `repmgr` to Patroni.
A production-ready and secure setup requires at least three Patroni instances on
the primary, and a similar configuration on the secondary nodes. Be sure to use
password credentials and other database best practices.
the primary site, and a similar configuration on the secondary sites. Be sure to
use password credentials and other database best practices.
Similar to `repmgr`, using Patroni on a secondary node is optional.
To set up database replication with Patroni on a secondary node, configure a
_permanent replication slot_ on the primary node's Patroni cluster, and ensure
password authentication is used.
On Patroni instances for the primary node, add the following to the
`/etc/gitlab/gitlab.rb` file:
```ruby
# You need one entry for each secondary, with a unique name following PostgreSQL slot_name constraints:
'PATRONI_SECONDARY1_IP/32','PATRONI_SECONDARY2_IP/32','PATRONI_SECONDARY3_IP/32'# we list all secondary instances as they can all become a Standby Leader
# any other instance that needs access to the database as per documentation
# We don't support setting a permanent replication slot for logical replication type
patroni['replication_slots']={
'geo_secondary'=>{'type'=>'physical'}
}
patroni['use_pg_rewind']=true
patroni['postgresql']['max_wal_senders']=8# Use double of the amount of patroni/reserved slots (3 patronis + 1 reserved slot for a Geo secondary).
patroni['postgresql']['max_replication_slots']=8# Use double of the amount of patroni/reserved slots (3 patronis + 1 reserved slot for a Geo secondary).
'PATRONI_SECONDARY1_IP/32','PATRONI_SECONDARY2_IP/32','PATRONI_SECONDARY3_IP/32','PATRONI_SECONDARY_PGBOUNCER/32'# We list all secondary instances as they can all become a Standby Leader