Commit 2fc6b161 authored by Pavlo Strokov's avatar Pavlo Strokov Committed by Evan Read

Update doc on adding direct connection to Postgres

As Praefect now utilises a LISTEN functionality of the
Postgres database we should provide info on how to properly
configure a direct connection to the PostgreSQL database.

Part of: https://gitlab.com/gitlab-org/gitaly/-/issues/3334
parent 5b15540e
......@@ -254,8 +254,23 @@ The database used by Praefect is now configured.
To reduce PostgreSQL resource consumption, we recommend setting up and configuring
[PgBouncer](https://www.pgbouncer.org/) in front of the PostgreSQL instance. To do
this, replace value of the `POSTGRESQL_SERVER_ADDRESS` with corresponding IP or host
address of the PgBouncer instance.
this, set the corresponding IP or host address of the PgBouncer instance in
`/etc/gitlab/gitlab.rb` by changing the following settings:
- `praefect['database_host']`, for the address.
- `praefect['database_port']`, for the port.
Because PgBouncer manages resources more efficiently, Praefect still requires a
direct connection to the PostgreSQL database because it uses
[LISTEN](https://www.postgresql.org/docs/11/sql-listen.html)
functionality that is [not supported](https://www.pgbouncer.org/features.html) by
PgBouncer with `pool_mode = transaction`.
Therefore, `praefect['database_host_no_proxy']` and `praefect['database_port_no_proxy']`
should be set to a direct connection and not a PgBouncer connection.
Save the changes to `/etc/gitlab/gitlab.rb` and
[reconfigure Praefect](../restart_gitlab.md#omnibus-gitlab-reconfigure).
This documentation doesn't provide PgBouncer installation instructions,
but you can:
......@@ -370,6 +385,8 @@ application server, or a Gitaly node.
praefect['database_user'] = 'praefect'
praefect['database_password'] = 'PRAEFECT_SQL_PASSWORD'
praefect['database_dbname'] = 'praefect_production'
praefect['database_host_no_proxy'] = 'POSTGRESQL_SERVER_ADDRESS'
praefect['database_port_no_proxy'] = 5432
```
If you want to use a TLS client certificate, the options below can be used:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment