2018-05-09 12:11:28 -04:00
|
|
|
# Configure GitLab using an external PostgreSQL service
|
|
|
|
|
|
|
|
If you're hosting GitLab on a cloud provider, you can optionally use a
|
|
|
|
managed service for PostgreSQL. For example, AWS offers a managed Relational
|
|
|
|
Database Service (RDS) that runs PostgreSQL.
|
|
|
|
|
|
|
|
Alternatively, you may opt to manage your own PostgreSQL instance or cluster
|
2020-04-29 23:09:32 -04:00
|
|
|
separate from the Omnibus GitLab package.
|
2018-05-09 12:11:28 -04:00
|
|
|
|
|
|
|
If you use a cloud-managed service, or provide your own PostgreSQL instance:
|
|
|
|
|
2018-09-19 12:03:00 -04:00
|
|
|
1. Set up PostgreSQL according to the
|
2018-05-09 12:11:28 -04:00
|
|
|
[database requirements document](../install/requirements.md#database).
|
|
|
|
1. Set up a `gitlab` username with a password of your choice. The `gitlab` user
|
|
|
|
needs privileges to create the `gitlabhq_production` database.
|
2020-05-11 11:09:37 -04:00
|
|
|
1. Configure the GitLab application servers with the appropriate connection details
|
|
|
|
for your external PostgreSQL service in your `/etc/gitlab/gitlab.rb` file:
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
# Disable the bundled Omnibus provided PostgreSQL
|
|
|
|
postgresql['enable'] = false
|
|
|
|
|
|
|
|
# PostgreSQL connection details
|
|
|
|
gitlab_rails['db_adapter'] = 'postgresql'
|
|
|
|
gitlab_rails['db_encoding'] = 'unicode'
|
|
|
|
gitlab_rails['db_host'] = '10.1.0.5' # IP/hostname of database server
|
|
|
|
gitlab_rails['db_password'] = 'DB password'
|
|
|
|
```
|
|
|
|
|
|
|
|
For more information on GitLab HA setups, refer to [configuring GitLab for HA](high_availability/gitlab.md).
|
|
|
|
|
|
|
|
1. Reconfigure for the changes to take effect:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
sudo gitlab-ctl reconfigure
|
|
|
|
```
|