@@ -497,54 +497,135 @@ For instructions about how to set up Patroni on the primary node, see the
...
@@ -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.
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
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
the primary site, and a similar configuration on the secondary sites. Be sure to
password credentials and other database best practices.
use password credentials and other database best practices.
Similar to `repmgr`, using Patroni on a secondary node is optional.
Similar to `repmgr`, using Patroni on a secondary node is optional.
To set up database replication with Patroni on a secondary node, configure a
### Step 1. Configure Patroni permanent replication slot on the primary site
_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
To set up database replication with Patroni on a secondary node, we need to
`/etc/gitlab/gitlab.rb` file:
configure a _permanent replication slot_ on the primary node's Patroni cluster,
and ensure password authentication is used.
```ruby
For each Patroni instance on the primary site **starting on the Patroni
# You need one entry for each secondary, with a unique name following PostgreSQL slot_name constraints:
# We don't support setting a permanent replication slot for logical replication type
patroni['replication_slots']={
'geo_secondary'=>{'type'=>'physical'}
'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'# we list all secondary instances as they can all become a Standby Leader
'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
# any other instance that needs access to the database as per documentation