diff options
Diffstat (limited to 'doc/administration/geo/setup/external_database.md')
-rw-r--r-- | doc/administration/geo/setup/external_database.md | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/doc/administration/geo/setup/external_database.md b/doc/administration/geo/setup/external_database.md index 50383546da3..061ae2d4eb8 100644 --- a/doc/administration/geo/setup/external_database.md +++ b/doc/administration/geo/setup/external_database.md @@ -39,7 +39,7 @@ developed and tested. We aim to be compatible with most external ## ## The unique identifier for the Geo site. See - ## https://docs.gitlab.com/ee/administration/geo_nodes.html#common-settings + ## https://docs.gitlab.com/ee/administration/geo_sites.html#common-settings ## gitlab_rails['geo_node_name'] = '<site_name_here>' ``` @@ -189,6 +189,8 @@ potential replication issues. The Linux package automatically configures a track when `roles ['geo_secondary_role']` is set. If you want to run this database external to your Linux package installation, use the following instructions. +#### Cloud-managed database services + If you are using a cloud-managed service for the tracking database, you may need to grant additional roles to your tracking database user (by default, this is `gitlab_geo`): @@ -200,8 +202,6 @@ to grant additional roles to your tracking database user (by default, this is This is for the installation of extensions during installation and upgrades. As an alternative, [ensure the extensions are installed manually, and read about the problems that may arise during future GitLab upgrades](../../../install/postgresql_extensions.md). -To setup an external tracking database, follow the instructions below: - NOTE: If you want to use Amazon RDS as a tracking database, make sure it has access to the secondary database. Unfortunately, just assigning the same security group is not enough as @@ -209,9 +209,14 @@ outbound rules do not apply to RDS PostgreSQL databases. Therefore, you need to rule to the read-replica's security group allowing any TCP traffic from the tracking database on port 5432. +#### Create the tracking database + +Create and configure the tracking database in your PostgreSQL instance: + 1. Set up PostgreSQL according to the [database requirements document](../../../install/requirements.md#database). -1. Set up a `gitlab_geo` user with a password of your choice, create the `gitlabhq_geo_production` database, and make the user an owner of the database. You can see an example of this setup in the [installation from source documentation](../../../install/installation.md#7-database). +1. Set up a `gitlab_geo` user with a password of your choice, create the `gitlabhq_geo_production` database, and make the user an owner of the database. + You can see an example of this setup in the [self-compiled installation documentation](../../../install/installation.md#7-database). 1. If you are **not** using a cloud-managed PostgreSQL database, ensure that your secondary site can communicate with your tracking database by manually changing the `pg_hba.conf` that is associated with your tracking database. @@ -226,6 +231,10 @@ the tracking database on port 5432. host all all <trusted secondary IP>/32 md5 ``` +#### Configure GitLab + +Configure GitLab to use this database. These steps are for Linux package and Docker deployments. + 1. SSH into a GitLab **secondary** server and login as root: ```shell @@ -246,14 +255,19 @@ the tracking database on port 5432. 1. Save the file and [reconfigure GitLab](../../restart_gitlab.md#reconfigure-a-linux-package-installation) -1. The reconfigure should automatically create the database. If needed, you can perform this task manually. This task (whether run by itself or during reconfigure) requires the database user to be a superuser. +#### Set up the database schema + +The reconfigure in the [steps above](#configure-gitlab) for Linux package and Docker deployments should handle these steps automatically. + +1. This task creates the database schema. It requires the database user to be a superuser. ```shell - gitlab-rake db:create:geo + sudo gitlab-rake db:create:geo ``` -1. The reconfigure should automatically migrate the database. You can migrate the database manually if needed, for example if `geo_secondary['auto_migrate'] = false`: +1. Applying Rails database migrations (schema and data updates) is also performed by reconfigure. If `geo_secondary['auto_migrate'] = false` is set, or + the schema was created manually, this step will be required: ```shell - gitlab-rake db:migrate:geo + sudo gitlab-rake db:migrate:geo ``` |