Commit 874e714c authored by Marcin Sedlak-Jakubowski's avatar Marcin Sedlak-Jakubowski

Merge branch 'add-pg-btree_gist-docs' into 'master'

Document PSQL `btree_gist` extension requirement

See merge request gitlab-org/gitlab!33118
parents e30e95e9 a38921bd
......@@ -305,6 +305,12 @@ Select one node as a primary node.
CREATE EXTENSION pg_trgm;
```
1. Enable the `btree_gist` extension:
```shell
CREATE EXTENSION btree_gist;
```
1. Exit the database prompt by typing `\q` and Enter.
1. Verify the cluster is initialized with one node:
......@@ -736,9 +742,9 @@ consul['configuration'] = {
After deploying the configuration follow these steps:
1. On `10.6.0.31`, our primary database
1. On `10.6.0.31`, our primary database:
Enable the `pg_trgm` extension
Enable the `pg_trgm` and `btree_gist` extensions:
```shell
gitlab-psql -d gitlabhq_production
......@@ -746,33 +752,34 @@ After deploying the configuration follow these steps:
```shell
CREATE EXTENSION pg_trgm;
CREATE EXTENSION btree_gist;
```
1. On `10.6.0.32`, our first standby database
1. On `10.6.0.32`, our first standby database:
Make this node a standby of the primary
Make this node a standby of the primary:
```shell
gitlab-ctl repmgr standby setup 10.6.0.21
```
1. On `10.6.0.33`, our second standby database
1. On `10.6.0.33`, our second standby database:
Make this node a standby of the primary
Make this node a standby of the primary:
```shell
gitlab-ctl repmgr standby setup 10.6.0.21
```
1. On `10.6.0.41`, our application server
1. On `10.6.0.41`, our application server:
Set `gitlab-consul` user's PgBouncer password to `toomanysecrets`
Set `gitlab-consul` user's PgBouncer password to `toomanysecrets`:
```shell
gitlab-ctl write-pgpass --host 127.0.0.1 --database pgbouncer --user pgbouncer --hostuser gitlab-consul
```
Run database migrations
Run database migrations:
```shell
gitlab-rake gitlab:db:configure
......@@ -1324,7 +1331,7 @@ You can switch an exiting database cluster to use Patroni instead of repmgr with
NOTE: **Note:**
Ensure that there is no `walsender` process running on the primary node.
`ps aux | grep walsender` must not show any running process.
`ps aux | grep walsender` must not show any running process.
1. On the primary node, [configure Patroni](#configuring-patroni-cluster). Remove `repmgr` and any other
repmgr-specific configuration. Also remove any configuration that is related to PostgreSQL replication.
......
......@@ -57,6 +57,7 @@ This section is for links to information elsewhere in the GitLab documentation.
- [GitLab database requirements](../../install/requirements.md#database) including
- Support for MySQL was removed in GitLab 12.1; [migrate to PostgreSQL](../../update/mysql_to_postgresql.md)
- required extension `pg_trgm`
- required extension `btree_gist`
- required extension `postgres_fdw` for Geo
- Errors like this in the `production/sidekiq` log; see: [Set default_transaction_isolation into read committed](https://docs.gitlab.com/omnibus/settings/database.html#set-default_transaction_isolation-into-read-committed):
......
......@@ -473,9 +473,9 @@ Since we're adding our SSL certificate at the load balancer, we do not need GitL
sudo gitlab-ctl reconfigure
```
#### Install the `pg_trgm` extension for PostgreSQL
#### Install the required extensions for PostgreSQL
From your GitLab instance, connect to the RDS instance to verify access and to install the required `pg_trgm` extension.
From your GitLab instance, connect to the RDS instance to verify access and to install the required `pg_trgm` and `btree_gist` extensions.
To find the host or endpoint, navigate to **Amazon RDS > Databases** and click on the database you created earlier. Look for the endpoint under the **Connectivity & security** tab.
......@@ -492,6 +492,7 @@ psql (10.9)
Type "help" for help.
gitlab=# CREATE EXTENSION pg_trgm;
gitlab=# CREATE EXTENSION btree_gist;
gitlab=# \q
```
......
......@@ -339,6 +339,12 @@ Starting from GitLab 12.1, only PostgreSQL is supported. Since GitLab 13.0, we r
sudo -u postgres psql -d template1 -c "CREATE EXTENSION IF NOT EXISTS pg_trgm;"
```
1. Create the `btree_gist` extension (required for GitLab 13.1+):
```shell
sudo -u postgres psql -d template1 -c "CREATE EXTENSION IF NOT EXISTS btree_gist;"
```
1. Create the GitLab production database and grant all privileges on the database:
```shell
......@@ -369,6 +375,24 @@ Starting from GitLab 12.1, only PostgreSQL is supported. Since GitLab 13.0, we r
(1 row)
```
1. Check if the `btree_gist` extension is enabled:
```sql
SELECT true AS enabled
FROM pg_available_extensions
WHERE name = 'btree_gist'
AND installed_version IS NOT NULL;
```
If the extension is enabled this will produce the following output:
```plaintext
enabled
---------
t
(1 row)
```
1. Quit the database session:
```shell
......
......@@ -140,8 +140,8 @@ GitLab version | Minimum PostgreSQL version
12.10 | 11
13.0 | 11
You must also ensure the `pg_trgm` extension is loaded into every
GitLab database. This extension [can be enabled](https://www.postgresql.org/docs/11/sql-createextension.html) using a PostgreSQL super user.
You must also ensure the `pg_trgm` and `btree_gist` extensions are loaded into every
GitLab database. These extensions [can be enabled](https://www.postgresql.org/docs/11/sql-createextension.html) using a PostgreSQL super user.
On some systems you may need to install an additional package (for example,
`postgresql-contrib`) for this extension to become available.
......
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