Commit 9fc1fb5d authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Refactor update info for Geo 9.0

[ci skip]
parent 5c0439d3
...@@ -4,58 +4,110 @@ In order to update the GitLab Geo nodes when a new GitLab version is released, ...@@ -4,58 +4,110 @@ In order to update the GitLab Geo nodes when a new GitLab version is released,
all you need to do is update GitLab itself: all you need to do is update GitLab itself:
1. Log into each node (primary and secondaries) 1. Log into each node (primary and secondaries)
1. [Update GitLab](../update/README.md) 1. [Update GitLab][update]
1. Test primary and secondary nodes, and check version in each. 1. Test primary and secondary nodes, and check version in each.
# Upgrade to 9.0.x ## Special update notes for 9.0.x
> **IMPORTANT**: 9.0 requires manual steps in the secondary nodes, > **IMPORTANT**:
because we are upgrading PostgreSQL to 9.6 on the primary and Postgres With GitLab 9.0, the PostgreSQL version is upgraded to 9.6 and manual steps are
doesn't support upgrading secondary nodes while keeping the required in order to update the secondary nodes and keep the Streaming
Streaming Replication working. Replication working. Downtime is required, so plan ahead.
Before starting the upgrade to 9.0 on both **primary** and **secondary** nodes, The following steps apply only if you upgrade from a 8.17 GitLab version to
stop all service in each secondary nodes: `gitlab-ctl stop` and make a backup of 9.0+. For previous versions, update to GitLab 8.17 first before attempting to
the `recovery.conf` located at: `/var/opt/gitlab/postgresql/data/recovery.conf` upgrade to 9.0+.
Follow regular upgrade instruction for 9.0 on the primary node. ---
At the end of the upgrade procedures your primary node will be running with Make sure to follow the steps in the exact order as they appear below and pay
PostgreSQL on 9.6.x branch. To prevent a desynchronization of the repository extra attention in what node (primary/secondary) you execute them! Each step
replication, follow these steps to stop all services but the `postgresql` as is prepended with the relevant node for better clarity:
we will use it to re-initialize the secondary node's database:
**Run in the primary node:** 1. **[secondary]** Login to **all** your secondary nodes and stop all services:
``` ```ruby
sudo gitlab-ctl stop sudo gitlab-ctl stop
sudo gitlab-ctl start postgresql ```
```
**Run in the secondary node:** 1. **[secondary]** Make a backup of the `recovery.conf` file on **all**
secondary nodes to preserve PostgreSQL's credentials:
Follow the instructions [here](https://docs.gitlab.com/ee/gitlab-geo/database.html#step-3-initiate-the-replication-process) ```
to Create the `replica.sh` script and execute the instructions below: sudo cp /var/opt/gitlab/postgresql/data/recovery.conf /var/opt/gitlab/
```
``` 1. **[primary]** Update the primary node to GitLab 9.0 following the
gitlab-ctl stop [regular update docs][update]. At the end of the update, the primary node
will be running with PostgreSQL 9.6.
# backup the recovery.conf from postgresql to preserv credentials 1. **[primary]** To prevent a de-synchronization of the repository replication,
sudo cp /var/opt/gitlab/postgresql/data/recovery.conf /var/opt/gitlab stop all services except `postgresql` as we will use it to re-initialize the
secondary node's database:
# prevent running database migrations on the secondary node: ```
touch /etc/gitlab/skip-auto-migrations sudo gitlab-ctl stop
sudo gitlab-ctl start postgresql
```
# let's disable the old database: 1. **[secondary]** Run the following steps on each of the secondaries:
mv /var/opt/gitlab/postgresql{,.bak}
gitlab-ctl reconfigure 1. **[secondary]** Create the `replica.sh` script as described in the
gitlab-ctl pg-upgrade [database configuration document](database.md#step-3-initiate-the-replication-process).
# see the stored credentials for the database, that you will need to re-initialize replication: 1. **[secondary]** Stop all services:
grep -s primary_conninfo /var/opt/gitlab/recovery.conf
# run the recovery script with the credentials above ```
bash /tmp/replica.sh sudo gitlab-ctl stop
``` ```
1. **[secondary]** Prevent running database migrations:
```
sudo touch /etc/gitlab/skip-auto-migrations
```
1. **[secondary]** Move the old database to another directory:
```
sudo mv /var/opt/gitlab/postgresql{,.bak}
```
1. **[secondary]** Update to GitLab 9.0 following the [regular update docs][update].
At the end of the update, the node will be running with PostgreSQL 9.6.
1. **[secondary]** Reconfigure GitLab:
```
sudo gitlab-ctl reconfigure
```
1. **[secondary]** Run the PostgreSQL upgrade command:
```
sudo gitlab-ctl pg-upgrade
```
1. **[secondary]** See the stored credentials for the database that you will
need to re-initialize the replication:
```
sudo grep -s primary_conninfo /var/opt/gitlab/recovery.conf
```
1. **[secondary]** Run the recovery script using the credentials from the
previous step:
```
sudo bash /tmp/replica.sh
```
1. **[secondary]** Start all services:
```
sudo gitlab-ctl start
```
1. **[secondary]** Repeat the steps for the rest of the secondaries.
[update]: ../update/README.md
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