Commit 39aee3da authored by James Ramsay's avatar James Ramsay

Second significant attempt

parent d8f5b8ff
...@@ -80,6 +80,7 @@ will not be able to perform all necessary configuration steps. Refer to ...@@ -80,6 +80,7 @@ will not be able to perform all necessary configuration steps. Refer to
else. else.
1. Set up TLS support for the PostgreSQL primary server 1. Set up TLS support for the PostgreSQL primary server
> **Warning**: Only skip this step if you **know** that PostgreSQL traffic > **Warning**: Only skip this step if you **know** that PostgreSQL traffic
> between the primary and secondary will be secured through some other > between the primary and secondary will be secured through some other
> means, e.g., a known-safe physical network path or a site-to-site VPN that > means, e.g., a known-safe physical network path or a site-to-site VPN that
...@@ -153,31 +154,42 @@ will not be able to perform all necessary configuration steps. Refer to ...@@ -153,31 +154,42 @@ will not be able to perform all necessary configuration steps. Refer to
connect to the primary's database. For this reason, we need the IP address connect to the primary's database. For this reason, we need the IP address
of each node. of each node.
To lookup the interface IP address of the primary, on the primary execute: If you are use a cloud provider, you can lookup the IP addresses for each
geo node through their management console. A table of terminology is
```bash provided below because terminology varies between vendors.
# Primary interface IP address
ip route get 255.255.255.255 | awk '{print $NF; exit}'
```
Depending on your network configuration, the primary and secondary may | GitLab Terminology | Amazon Web Services | Google Cloud Platform |
connect over the public internet, a local area network, or a virtual |-----|-----|-----|-----|
network connecting availability zones like Amazon's [Virtual Private | Interface address | Private address | Internal address |
Cloud](https://aws.amazon.com/vpc/). If you are using a local or virtual | Public address | Public address | External address |
network use the interface IP address, otherwise use the public IP address.
To lookup addresses, on the secondary execute: To lookup the IP address of a geo node, on the geo node execute:
```bash ```bash
# Secondary interface IP address # Interface IP address
ip route get 255.255.255.255 | awk '{print $NF; exit}' ip route get 255.255.255.255 | awk '{print $NF; exit}'
# Secondary public IP address # Public IP address
curl ipinfo.io/ip curl ipinfo.io/ip
``` ```
In most instances, the following addresses will be used to configure
GitLab Geo:
| Configuration | Address |
|-----|-----|
| `postgresql['listen_address']` | Primary's interface address |
| `postgresql['trust_auth_cidr_addresses']` | Primary's interface address |
| `postgresql['md5_auth_cidr_addresses']` | Secondary's public addresses |
Depending on your network configuration, the suggested addresses may not
be correct. For example, if your primary and secondary connect over a local
area network, or a virtual network connecting availability zones like
Amazon's [Virtual Private Cloud](https://aws.amazon.com/vpc/) you should
use the secondary's interface address for `postgresql['md5_auth_cidr_addresses']`.
Edit `/etc/gitlab/gitlab.rb` and add the following, replacing the secondary Edit `/etc/gitlab/gitlab.rb` and add the following, replacing the IP
IP addresses with address appropriate to your network configuration: addresses with addresses appropriate to your network configuration:
```ruby ```ruby
geo_primary_role['enable'] = true geo_primary_role['enable'] = true
...@@ -188,8 +200,7 @@ will not be able to perform all necessary configuration steps. Refer to ...@@ -188,8 +200,7 @@ will not be able to perform all necessary configuration steps. Refer to
postgresql['trust_auth_cidr_addresses'] = ['127.0.0.1/32','1.2.3.4/32'] postgresql['trust_auth_cidr_addresses'] = ['127.0.0.1/32','1.2.3.4/32']
# Secondary IP addresses # Secondary IP addresses
# - local/virtual networks: replace '5.6.7.8' with the secondary interface IP address # - replace '5.6.7.8' with the secondary public IP address
# - otherwise: replace '5.6.7.8' with the secondary public IP address
postgresql['md5_auth_cidr_addresses'] = ['5.6.7.8/32'] postgresql['md5_auth_cidr_addresses'] = ['5.6.7.8/32']
# Replication settings # Replication settings
...@@ -209,7 +220,7 @@ will not be able to perform all necessary configuration steps. Refer to ...@@ -209,7 +220,7 @@ will not be able to perform all necessary configuration steps. Refer to
1. Optional: If you want to add another secondary, the relevant setting would look like: 1. Optional: If you want to add another secondary, the relevant setting would look like:
```ruby ```ruby
postgresql['md5_auth_cidr_addresses'] = ['5.6.7.8/32','11.22.33.44/32'] postgresql['md5_auth_cidr_addresses'] = ['5.6.7.8/32','9.10.11.12/32']
``` ```
You may also want to edit the `wal_keep_segments` and `max_wal_senders` to You may also want to edit the `wal_keep_segments` and `max_wal_senders` to
......
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