If your GitLab installation uses external PostgreSQL, the Omnibus roles
If your GitLab installation uses external (not managed by Omnibus) PostgreSQL
will not be able to perform all necessary configuration steps. Refer to the
instances, the Omnibus roles will not be able to perform all necessary
section on [External PostgreSQL][external postgresql] for additional instructions.
configuration steps. In this case, refer to
[additional instructions](external_database.md).
NOTE: **Note:**
NOTE: **Note:**
The stages of the setup process must be completed in the documented order.
The stages of the setup process must be completed in the documented order.
...
@@ -21,7 +22,6 @@ have to change some values according to your database setup, how big it is, etc.
...
@@ -21,7 +22,6 @@ have to change some values according to your database setup, how big it is, etc.
You are encouraged to first read through all the steps before executing them
You are encouraged to first read through all the steps before executing them
in your testing/production environment.
in your testing/production environment.
## PostgreSQL replication
## PostgreSQL replication
The GitLab primary node where the write operations happen will connect to
The GitLab primary node where the write operations happen will connect to
...
@@ -54,7 +54,6 @@ CAUTION: **Warning:**
...
@@ -54,7 +54,6 @@ CAUTION: **Warning:**
Geo works with streaming replication. Logical replication is not supported at this time.
Geo works with streaming replication. Logical replication is not supported at this time.
There is an [issue where support is being discussed](https://gitlab.com/gitlab-org/gitlab-ee/issues/7420).
There is an [issue where support is being discussed](https://gitlab.com/gitlab-org/gitlab-ee/issues/7420).
### Step 1. Configure the primary server
### Step 1. Configure the primary server
1. SSH into your GitLab **primary** server and login as root:
1. SSH into your GitLab **primary** server and login as root:
...
@@ -117,7 +116,7 @@ There is an [issue where support is being discussed](https://gitlab.com/gitlab-o
...
@@ -117,7 +116,7 @@ There is an [issue where support is being discussed](https://gitlab.com/gitlab-o
For security reasons, PostgreSQL does not listen on any network interfaces
For security reasons, PostgreSQL does not listen on any network interfaces
by default. However, Geo requires the secondary to be able to
by default. However, Geo requires the secondary to be able to
connect to the primary's database. For this reason, we need the address of
connect to the primary's database. For this reason, we need the address of
each node. Note: For external PostgreSQL instances, see [additional instructions][external postgresql].
each node. Note: For external PostgreSQL instances, see [additional instructions](external_database.md).
If you are using a cloud provider, you can lookup the addresses for each
If you are using a cloud provider, you can lookup the addresses for each
Geo node through your cloud provider's management console.
Geo node through your cloud provider's management console.
...
@@ -291,7 +290,6 @@ There is an [issue where support is being discussed](https://gitlab.com/gitlab-o
...
@@ -291,7 +290,6 @@ There is an [issue where support is being discussed](https://gitlab.com/gitlab-o
editor server.crt
editor server.crt
```
```
1. Set up PostgreSQL TLS verification on the secondary
1. Set up PostgreSQL TLS verification on the secondary
Install the `server.crt` file:
Install the `server.crt` file:
...
@@ -318,7 +316,7 @@ There is an [issue where support is being discussed](https://gitlab.com/gitlab-o
...
@@ -318,7 +316,7 @@ There is an [issue where support is being discussed](https://gitlab.com/gitlab-o
Ensure that the contents of `~gitlab-psql/data/server.crt` on the primary
Ensure that the contents of `~gitlab-psql/data/server.crt` on the primary
match the contents of `~gitlab-psql/.postgresql/root.crt` on the secondary.
match the contents of `~gitlab-psql/.postgresql/root.crt` on the secondary.
1. Configure PostreSQL to enable FDW support
1. Configure PostgreSQL to enable FDW support
This step is similar to how we configured the primary instance.
This step is similar to how we configured the primary instance.
We need to enable this, to enable FDW support, even if using a single node.
We need to enable this, to enable FDW support, even if using a single node.
...
@@ -353,7 +351,7 @@ There is an [issue where support is being discussed](https://gitlab.com/gitlab-o
...
@@ -353,7 +351,7 @@ There is an [issue where support is being discussed](https://gitlab.com/gitlab-o
geo_secondary['db_fdw'] = true
geo_secondary['db_fdw'] = true
```
```
For external PostgreSQL instances, [see additional instructions][external postgresql].
For external PostgreSQL instances, see [additional instructions](external_database.md).
If you bring a former **primary** node back online to serve as a **secondary** node, then you also need to remove `roles ['geo_primary_role']` or `geo_primary_role['enable'] = true`.
If you bring a former **primary** node back online to serve as a **secondary** node, then you also need to remove `roles ['geo_primary_role']` or `geo_primary_role['enable'] = true`.
1. Reconfigure GitLab for the changes to take effect:
1. Reconfigure GitLab for the changes to take effect:
...
@@ -430,137 +428,6 @@ data before running `pg_basebackup`.
...
@@ -430,137 +428,6 @@ data before running `pg_basebackup`.
The replication process is now complete.
The replication process is now complete.
### External PostgreSQL instances
For installations using external PostgreSQL instances, the `geo_primary_role`
and `geo_secondary_role` includes configuration changes that must be applied
manually.
The `geo_primary_role` makes configuration changes to `pg_hba.conf` and
@@ -141,7 +141,17 @@ On some systems you may need to install an additional package (e.g.
...
@@ -141,7 +141,17 @@ On some systems you may need to install an additional package (e.g.
#### Additional requirements for GitLab Geo
#### Additional requirements for GitLab Geo
If you are using [GitLab Geo](https://docs.gitlab.com/ee/development/geo.html), the [tracking database](https://docs.gitlab.com/ee/development/geo.html#geo-tracking-database) also requires the `postgres_fdw` extension.
If you are using [GitLab Geo](https://docs.gitlab.com/ee/development/geo.html):
- We strongly recommend running Omnibus-managed instances as they are actively
developed and tested. We aim to be compatible with most external (not managed
by Omnibus) databases (for example, AWS RDS) but we do not guarantee