1. Replicate some required configurations between the primary and the secondaries
1. Replicate some required configurations between the primary and the secondaries
1. Start GitLab in the secondary node's machine
1. Start GitLab on the secondary node's machine
1. Configure every secondary node in the primary's Admin screen
1. Configure every secondary node in the primary's Admin screen
After GitLab's instance is online and defined in **Geo Nodes** admin screen,
After GitLab's instance is online and defined in **Geo Nodes** admin screen,
...
@@ -20,12 +21,15 @@ old data from the primary machine (more information below).
...
@@ -20,12 +21,15 @@ old data from the primary machine (more information below).
## Primary node GitLab setup
## Primary node GitLab setup
>**Notes:**
>**Notes:**
- You will need to setup your database into a **Primary <-> Secondary (read-only)** replication
- You will need to setup your database into a **Primary <-> Secondary (read-only)**
topology, and your Primary node should always point to a database's Primary
replication topology, and your Primary node should always point to a
instance. If you haven't done that already, read [database replication](./database.md).
database's Primary instance. If you haven't done that already, follow
[database replication](./database.md).
- Only in the Geo nodes admin area of the primary node, will you be adding all
- Only in the Geo nodes admin area of the primary node, will you be adding all
nodes' information (secondary and primary). Do not add anything in the Geo
nodes' information (secondary and primary). Do not add anything in the Geo
nodes admin area of the secondaries.
nodes admin area of the secondaries.
- Each node needs to have the `external_url` in their `gitlab.rb` file properly
set to the real URL or IP address where the other nodes can reach them.
To setup the primary node:
To setup the primary node:
...
@@ -48,27 +52,26 @@ In the following table you can see what all these settings mean:
...
@@ -48,27 +52,26 @@ In the following table you can see what all these settings mean:
| Setting | Description |
| Setting | Description |
| --------- | ----------- |
| --------- | ----------- |
| Primary | This marks a Geo Node as primary. There can be only one primary, make sure that you first add the primary node and then all the others. |
| Primary | This marks a Geo Node as primary. There can be only one primary, make sure that you first add the primary node and then all the others. |
| URL | Your instance's full URL, in the same way it is configured in `gitlab.yml` (source based installations) or `/etc/gitlab/gitlab.rb` (omnibus installations). |
| URL | Your instance's full URL, in the same way it is configured in `/etc/gitlab/gitlab.rb` |
|Public Key | The SSH public key of the user that your GitLab instance runs on (unless changed, should be the user `git`). That means that you have to go in each Geo Node separately and create an SSH key pair. See the [SSH key creation][ssh-pair] section. |
|Public Key | The SSH public key of the user that your GitLab instance runs on (unless changed, should be the user `git`). That means that you have to go in each Geo Node separately and create an SSH key pair. See the [SSH key creation][ssh-pair] section. |
## Secondary node GitLab setup
## Secondary node GitLab setup
>**Note:**
>**Notes:**
The Geo nodes admin area (**Admin Area > Geo Nodes**) is not used when setting
- The Geo nodes admin area (**Admin Area > Geo Nodes**) is not used when setting
up the secondary nodes. This is handled at the primary one.
up the secondary nodes. This is handled at the primary one.
- To install a secondary node, you must follow the normal GitLab Enterprise
To install a secondary node, you must follow the normal GitLab Enterprise
Edition installation, with some extra requirements:
Edition installation, with some extra requirements:
1. Follow the [setup database replication](./database.md) instructions.
1. Your secondary node should be allowed to [communicate via HTTP/HTTPS and
- You should point your database connection to a [replicated instance](./database.md).
SSH with your primary node (make sure your firewall is not blocking that).
- Your secondary node should be allowed to [communicate via HTTP/HTTPS and
1. Don't make any extra steps you would do for a normal new installation.
SSH with your primary node (make sure your firewall is not blocking that).
1. Run `sudo gitlab-ctl reconfigure` after installing
- Don't make any extra steps you would do for a normal new installation
1. Don't setup any custom authentication or user accounts (this will be
- Don't setup any custom authentication (this will be handled by the `primary` node)
handled by the **primary** node)
1. You need to make sure you restored the database backup (the script in the
You need to make sure you restored the database backup (that is part of setting
database replication setup) and that the primary node PostgreSQL instance is
up replication) and that the primary node PostgreSQL instance is ready to
ready to replicate data.
replicate data.
### Database Encryption Key
### Database Encryption Key
...
@@ -78,8 +81,7 @@ sensitive data in the database.
...
@@ -78,8 +81,7 @@ sensitive data in the database.
Any secondary node must have the **exact same value** for `db_key_base` as
Any secondary node must have the **exact same value** for `db_key_base` as
defined in the primary one.
defined in the primary one.
- For Omnibus installations it is stored at `/etc/gitlab/gitlab-secrets.json`.
- It is stored at `/etc/gitlab/gitlab-secrets.json`.
- For installations from source it is stored at `/home/git/gitlab/config/secrets.yml`.
Find that key in the primary node and copy paste its value in the secondaries.
Find that key in the primary node and copy paste its value in the secondaries.
...
@@ -112,17 +114,13 @@ The two most obvious issues that replication can have here are:
...
@@ -112,17 +114,13 @@ The two most obvious issues that replication can have here are:
Getting a new secondary Geo node up and running, will also require the
Getting a new secondary Geo node up and running, will also require the
repositories directory to be synced from the primary node. You can use `rsync`
repositories directory to be synced from the primary node. You can use `rsync`
for that. Assuming `1.2.3.4` is the IP of the primary node, SSH into the
for that. Assuming `1.2.3.4` is the IP of the primary node, and that you have