Commit 054f869f authored by Cindy Pallares's avatar Cindy Pallares

Add note to collect CONSUL_SERVER_NODES in HA docs

There are several instances in our HA docs where an example of
`Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z` is given,
but this value isn't explicitly stated. It should be
the IP addresses or DNS records of the Consul server nodes.
parent eeb81259
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
Gitaly does not yet support full high availability. However, Gitaly is quite Gitaly does not yet support full high availability. However, Gitaly is quite
stable and is in use on GitLab.com. Scaled and highly available GitLab environments stable and is in use on GitLab.com. Scaled and highly available GitLab environments
should consider using Gitaly on a separate node. should consider using Gitaly on a separate node.
See the [Gitaly HA Epic](https://gitlab.com/groups/gitlab-org/-/epics/289) to See the [Gitaly HA Epic](https://gitlab.com/groups/gitlab-org/-/epics/289) to
track plans and progress toward high availability support. track plans and progress toward high availability support.
This document is relevant for [Scaled Architecture](README.md#scalable-architecture-examples) This document is relevant for [Scaled Architecture](README.md#scalable-architecture-examples)
environments and [High Availability Architecture](README.md#high-availability-architecture-examples). environments and [High Availability Architecture](README.md#high-availability-architecture-examples).
## Running Gitaly on its own server ## Running Gitaly on its own server
...@@ -24,23 +24,25 @@ Continue configuration of other components by going back to: ...@@ -24,23 +24,25 @@ Continue configuration of other components by going back to:
> [Introduced](https://gitlab.com/gitlab-org/omnibus-gitlab/issues/3786) in GitLab 12.0. > [Introduced](https://gitlab.com/gitlab-org/omnibus-gitlab/issues/3786) in GitLab 12.0.
1. Create/edit `/etc/gitlab/gitlab.rb` and add the following configuration: 1. Make sure to collect [`CONSUL_SERVER_NODES`](database.md#consul-information), which are the IP addresses or DNS records of the Consul server nodes, for the next step. Note they are presented as `Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z`
```ruby 1. Create/edit `/etc/gitlab/gitlab.rb` and add the following configuration:
# Enable service discovery for Prometheus
consul['enable'] = true
consul['monitoring_service_discovery'] = true
# Replace placeholders ```ruby
# Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z # Enable service discovery for Prometheus
# with the addresses of the Consul server nodes consul['enable'] = true
consul['configuration'] = { consul['monitoring_service_discovery'] = true
retry_join: %w(Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z),
}
# Set the network addresses that the exporters will listen on # Replace placeholders
node_exporter['listen_address'] = '0.0.0.0:9100' # Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z
gitaly['prometheus_listen_addr'] = "0.0.0.0:9236" # with the addresses of the Consul server nodes
``` consul['configuration'] = {
retry_join: %w(Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z),
}
1. Run `sudo gitlab-ctl reconfigure` to compile the configuration. # Set the network addresses that the exporters will listen on
node_exporter['listen_address'] = '0.0.0.0:9100'
gitaly['prometheus_listen_addr'] = "0.0.0.0:9236"
```
1. Run `sudo gitlab-ctl reconfigure` to compile the configuration.
...@@ -138,6 +138,8 @@ need some extra configuration. ...@@ -138,6 +138,8 @@ need some extra configuration.
If you enable Monitoring, it must be enabled on **all** GitLab servers. If you enable Monitoring, it must be enabled on **all** GitLab servers.
1. Make sure to collect [`CONSUL_SERVER_NODES`](database.md#consul-information), which are the IP addresses or DNS records of the Consul server nodes, for the next step. Note they are presented as `Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z`
1. Create/edit `/etc/gitlab/gitlab.rb` and add the following configuration: 1. Create/edit `/etc/gitlab/gitlab.rb` and add the following configuration:
```ruby ```ruby
......
...@@ -16,6 +16,8 @@ Omnibus: ...@@ -16,6 +16,8 @@ Omnibus:
package you want using **steps 1 and 2** from the GitLab downloads page. package you want using **steps 1 and 2** from the GitLab downloads page.
- Do not complete any other steps on the download page. - Do not complete any other steps on the download page.
1. Make sure to collect [`CONSUL_SERVER_NODES`](database.md#consul-information), which are the IP addresses or DNS records of the Consul server nodes, for the next step. Note they are presented as `Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z`
1. Edit `/etc/gitlab/gitlab.rb` and add the contents: 1. Edit `/etc/gitlab/gitlab.rb` and add the contents:
```ruby ```ruby
......
...@@ -22,10 +22,10 @@ environments including [Basic Scaling](README.md#basic-scaling) and ...@@ -22,10 +22,10 @@ environments including [Basic Scaling](README.md#basic-scaling) and
### Provide your own Redis instance **[CORE ONLY]** ### Provide your own Redis instance **[CORE ONLY]**
If you want to use your own deployed Redis instance(s), If you want to use your own deployed Redis instance(s),
see [Provide your own Redis instance](#provide-your-own-redis-instance-core-only) see [Provide your own Redis instance](#provide-your-own-redis-instance-core-only)
for more details. However, you can use the GitLab Omnibus package to easily for more details. However, you can use the GitLab Omnibus package to easily
deploy the bundled Redis. deploy the bundled Redis.
### Standalone Redis using GitLab Omnibus **[CORE ONLY]** ### Standalone Redis using GitLab Omnibus **[CORE ONLY]**
...@@ -62,11 +62,11 @@ Omnibus: ...@@ -62,11 +62,11 @@ Omnibus:
pgbouncer_exporter['enable'] = false pgbouncer_exporter['enable'] = false
gitlab_monitor['enable'] = false gitlab_monitor['enable'] = false
gitaly['enable'] = false gitaly['enable'] = false
redis['bind'] = '0.0.0.0' redis['bind'] = '0.0.0.0'
redis['port'] = '6379' redis['port'] = '6379'
redis['password'] = 'SECRET_PASSWORD_HERE' redis['password'] = 'SECRET_PASSWORD_HERE'
gitlab_rails['auto_migrate'] = false gitlab_rails['auto_migrate'] = false
``` ```
...@@ -74,7 +74,7 @@ Omnibus: ...@@ -74,7 +74,7 @@ Omnibus:
1. Note the Redis node's IP address or hostname, port, and 1. Note the Redis node's IP address or hostname, port, and
Redis password. These will be necessary when configuring the GitLab Redis password. These will be necessary when configuring the GitLab
application servers later. application servers later.
1. [Enable Monitoring](#enable-monitoring) 1. [Enable Monitoring](#enable-monitoring)
Advanced configuration options are supported and can be added if Advanced configuration options are supported and can be added if
needed. needed.
...@@ -91,10 +91,10 @@ environments including [Horizontal](README.md#horizontal), ...@@ -91,10 +91,10 @@ environments including [Horizontal](README.md#horizontal),
### Provide your own Redis instance **[CORE ONLY]** ### Provide your own Redis instance **[CORE ONLY]**
If you want to use your own deployed Redis instance(s), If you want to use your own deployed Redis instance(s),
see [Provide your own Redis instance](#provide-your-own-redis-instance-core-only) see [Provide your own Redis instance](#provide-your-own-redis-instance-core-only)
for more details. However, you can use the GitLab Omnibus package to easily for more details. However, you can use the GitLab Omnibus package to easily
deploy the bundled Redis. deploy the bundled Redis.
### High Availability with GitLab Omnibus **[PREMIUM ONLY]** ### High Availability with GitLab Omnibus **[PREMIUM ONLY]**
...@@ -368,7 +368,7 @@ The prerequisites for a HA Redis setup are the following: ...@@ -368,7 +368,7 @@ The prerequisites for a HA Redis setup are the following:
```ruby ```ruby
# Specify server role as 'redis_master_role' # Specify server role as 'redis_master_role'
roles ['redis_master_role'] roles ['redis_master_role']
# IP address pointing to a local IP that the other machines can reach to. # IP address pointing to a local IP that the other machines can reach to.
# You can also set bind to '0.0.0.0' which listen in all interfaces. # You can also set bind to '0.0.0.0' which listen in all interfaces.
# If you really need to bind to an external accessible IP, make # If you really need to bind to an external accessible IP, make
...@@ -382,7 +382,7 @@ The prerequisites for a HA Redis setup are the following: ...@@ -382,7 +382,7 @@ The prerequisites for a HA Redis setup are the following:
# Set up password authentication for Redis (use the same password in all nodes). # Set up password authentication for Redis (use the same password in all nodes).
redis['password'] = 'redis-password-goes-here' redis['password'] = 'redis-password-goes-here'
``` ```
1. Only the primary GitLab application server should handle migrations. To 1. Only the primary GitLab application server should handle migrations. To
prevent database migrations from running on upgrade, add the following prevent database migrations from running on upgrade, add the following
...@@ -394,8 +394,8 @@ The prerequisites for a HA Redis setup are the following: ...@@ -394,8 +394,8 @@ The prerequisites for a HA Redis setup are the following:
1. [Reconfigure Omnibus GitLab][reconfigure] for the changes to take effect. 1. [Reconfigure Omnibus GitLab][reconfigure] for the changes to take effect.
> Note: You can specify multiple roles like sentinel and redis as: > Note: You can specify multiple roles like sentinel and redis as:
> roles ['redis_sentinel_role', 'redis_master_role']. Read more about high > roles ['redis_sentinel_role', 'redis_master_role']. Read more about high
> availability roles at https://docs.gitlab.com/omnibus/roles/ > availability roles at https://docs.gitlab.com/omnibus/roles/
### Step 2. Configuring the slave Redis instances ### Step 2. Configuring the slave Redis instances
...@@ -412,7 +412,7 @@ The prerequisites for a HA Redis setup are the following: ...@@ -412,7 +412,7 @@ The prerequisites for a HA Redis setup are the following:
```ruby ```ruby
# Specify server role as 'redis_slave_role' # Specify server role as 'redis_slave_role'
roles ['redis_slave_role'] roles ['redis_slave_role']
# IP address pointing to a local IP that the other machines can reach to. # IP address pointing to a local IP that the other machines can reach to.
# You can also set bind to '0.0.0.0' which listen in all interfaces. # You can also set bind to '0.0.0.0' which listen in all interfaces.
# If you really need to bind to an external accessible IP, make # If you really need to bind to an external accessible IP, make
...@@ -443,8 +443,8 @@ The prerequisites for a HA Redis setup are the following: ...@@ -443,8 +443,8 @@ The prerequisites for a HA Redis setup are the following:
1. [Reconfigure Omnibus GitLab][reconfigure] for the changes to take effect. 1. [Reconfigure Omnibus GitLab][reconfigure] for the changes to take effect.
1. Go through the steps again for all the other slave nodes. 1. Go through the steps again for all the other slave nodes.
> Note: You can specify multiple roles like sentinel and redis as: > Note: You can specify multiple roles like sentinel and redis as:
> roles ['redis_sentinel_role', 'redis_slave_role']. Read more about high > roles ['redis_sentinel_role', 'redis_slave_role']. Read more about high
> availability roles at https://docs.gitlab.com/omnibus/roles/ > availability roles at https://docs.gitlab.com/omnibus/roles/
--- ---
...@@ -754,28 +754,30 @@ gitlab_rails['redis_sentinels'] = [ ...@@ -754,28 +754,30 @@ gitlab_rails['redis_sentinels'] = [
> [Introduced](https://gitlab.com/gitlab-org/omnibus-gitlab/issues/3786) in GitLab 12.0. > [Introduced](https://gitlab.com/gitlab-org/omnibus-gitlab/issues/3786) in GitLab 12.0.
If you enable Monitoring, it must be enabled on **all** Redis servers. If you enable Monitoring, it must be enabled on **all** Redis servers.
1. Make sure to collect [`CONSUL_SERVER_NODES`](database.md#consul-information), which are the IP addresses or DNS records of the Consul server nodes, for the next step. Note they are presented as `Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z`
1. Create/edit `/etc/gitlab/gitlab.rb` and add the following configuration: 1. Create/edit `/etc/gitlab/gitlab.rb` and add the following configuration:
```ruby ```ruby
# Enable service discovery for Prometheus # Enable service discovery for Prometheus
consul['enable'] = true consul['enable'] = true
consul['monitoring_service_discovery'] = true consul['monitoring_service_discovery'] = true
# Replace placeholders # Replace placeholders
# Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z # Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z
# with the addresses of the Consul server nodes # with the addresses of the Consul server nodes
consul['configuration'] = { consul['configuration'] = {
retry_join: %w(Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z), retry_join: %w(Y.Y.Y.Y consul1.gitlab.example.com Z.Z.Z.Z),
} }
# Set the network addresses that the exporters will listen on # Set the network addresses that the exporters will listen on
node_exporter['listen_address'] = '0.0.0.0:9100' node_exporter['listen_address'] = '0.0.0.0:9100'
redis_exporter['listen_address'] = '0.0.0.0:9121' redis_exporter['listen_address'] = '0.0.0.0:9121'
``` ```
1. Run `sudo gitlab-ctl reconfigure` to compile the configuration. 1. Run `sudo gitlab-ctl reconfigure` to compile the configuration.
## Advanced configuration ## Advanced configuration
......
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