diff options
Diffstat (limited to 'doc/administration/postgresql/database_load_balancing.md')
-rw-r--r-- | doc/administration/postgresql/database_load_balancing.md | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/doc/administration/postgresql/database_load_balancing.md b/doc/administration/postgresql/database_load_balancing.md index 805c4b2023f..15129770888 100644 --- a/doc/administration/postgresql/database_load_balancing.md +++ b/doc/administration/postgresql/database_load_balancing.md @@ -76,18 +76,20 @@ Database Load Balancing can be configured in one of two ways: ### Hosts -To configure a list of hosts, add the `gitlab_rails['db_load_balancing']` setting into the -`gitlab.rb` file in the GitLab Rails / Sidekiq nodes for each environment you want to balance. +To configure a list of hosts, perform these steps on all GitLab Rails (Sidekiq) +nodes for each environment you want to balance: -For example, on an environment that has PostgreSQL running on the hosts `host1.example.com`, -`host2.example.com` and `host3.example.com` and reachable on the same port configured with -`gitlab_rails['db_port']`: +1. Edit the `/etc/gitlab/gitlab.rb` file. +1. In `gitlab_rails['db_load_balancing']`, create an array of the read-only + replicas you want to balance. Do not add the primary host. For example, on + an environment with PostgreSQL running on the hosts `primary.example.com`, + `host1.example.com`, `host2.example.com`, and `host3.example.com`: -1. On each GitLab Rails / Sidekiq node, edit `/etc/gitlab/gitlab.rb` and add the following line: + ```ruby + gitlab_rails['db_load_balancing'] = { 'hosts' => ['host1.example.com', 'host2.example.com', `host3.example.com`] } + ``` - ```ruby - gitlab_rails['db_load_balancing'] = { 'hosts' => ['host1.example.com', 'host2.example.com', `host3.example.com`] } - ``` + These replicas must be reachable on the same port configured with `gitlab_rails['db_port']`. 1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure). |