diff options
Diffstat (limited to 'doc/administration/redis')
-rw-r--r-- | doc/administration/redis/replication_and_failover.md | 43 | ||||
-rw-r--r-- | doc/administration/redis/replication_and_failover_external.md | 22 | ||||
-rw-r--r-- | doc/administration/redis/troubleshooting.md | 8 |
3 files changed, 60 insertions, 13 deletions
diff --git a/doc/administration/redis/replication_and_failover.md b/doc/administration/redis/replication_and_failover.md index 2e56884e309..a37794ec44b 100644 --- a/doc/administration/redis/replication_and_failover.md +++ b/doc/administration/redis/replication_and_failover.md @@ -766,6 +766,49 @@ redis['master'] = false You can find the relevant attributes defined in [`gitlab_rails.rb`](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/libraries/gitlab_rails.rb). +### Control startup behavior + +> [Introduced](https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/6646) in GitLab 15.10. + +To prevent the bundled Redis service from starting at boot or restarting after changing its configuration: + +1. Edit `/etc/gitlab/gitlab.rb`: + + ```ruby + redis['start_down'] = true + ``` + +1. Reconfigure GitLab: + + ```shell + sudo gitlab-ctl reconfigure + ``` + +If you need to test a new replica node, you may set `start_down` to +`true` and manually start the node. After the new replica node is confirmed +working in the Redis cluster, set `start_down` to `false` and reconfigure GitLab +to ensure the node starts and restarts as expected during operation. + +### Control replica configuration + +> [Introduced](https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/6646) in GitLab 15.10. + +To prevent the `replicaof` line from rendering in the Redis configuration file: + +1. Edit `/etc/gitlab/gitlab.rb`: + + ```ruby + redis['set_replicaof'] = false + ``` + +1. Reconfigure GitLab: + + ```shell + sudo gitlab-ctl reconfigure + ``` + +This setting can be used to prevent replication of a Redis node independently of other Redis settings. + ## Troubleshooting See the [Redis troubleshooting guide](troubleshooting.md). diff --git a/doc/administration/redis/replication_and_failover_external.md b/doc/administration/redis/replication_and_failover_external.md index 23c9ce33c2d..14378b478da 100644 --- a/doc/administration/redis/replication_and_failover_external.md +++ b/doc/administration/redis/replication_and_failover_external.md @@ -32,15 +32,15 @@ Note the Redis node's IP address or hostname, port, and password (if required). 1. Configure the GitLab application servers with the appropriate connection details for your external Redis service in your `/etc/gitlab/gitlab.rb` file: - ```ruby - redis['enable'] = false + ```ruby + redis['enable'] = false - gitlab_rails['redis_host'] = 'redis.example.com' - gitlab_rails['redis_port'] = 6379 + gitlab_rails['redis_host'] = 'redis.example.com' + gitlab_rails['redis_port'] = 6379 - # Required if Redis authentication is configured on the Redis node - gitlab_rails['redis_password'] = 'Redis Password' - ``` + # Required if Redis authentication is configured on the Redis node + gitlab_rails['redis_password'] = 'Redis Password' + ``` 1. Reconfigure for the changes to take effect: @@ -87,7 +87,7 @@ valuable information for the general setup. Assuming that the Redis primary instance IP is `10.0.0.1`: -1. [Install Redis](../../install/installation.md#7-redis). +1. [Install Redis](../../install/installation.md#8-redis). 1. Edit `/etc/redis/redis.conf`: ```conf @@ -113,7 +113,7 @@ Assuming that the Redis primary instance IP is `10.0.0.1`: Assuming that the Redis replica instance IP is `10.0.0.2`: -1. [Install Redis](../../install/installation.md#7-redis). +1. [Install Redis](../../install/installation.md#8-redis). 1. Edit `/etc/redis/redis.conf`: ```conf @@ -250,8 +250,8 @@ unauthorized access from other machines, and block traffic from the outside ([Internet](https://gitlab.com/gitlab-org/gitlab-foss/uploads/c4cc8cd353604bd80315f9384035ff9e/The_Internet_IT_Crowd.png)). For this example, **Sentinel 1** is configured in the same machine as the -**Redis Primary**, **Sentinel 2** and **Sentinel 3** in the same machines as the -**Replica 1** and **Replica 2** respectively. +**Redis Primary**, **Sentinel 2** in the same machine as **Replica 1**, and +**Sentinel 3** in the same machine as **Replica 2**. Here is a list and description of each **machine** and the assigned **IP**: diff --git a/doc/administration/redis/troubleshooting.md b/doc/administration/redis/troubleshooting.md index 29407f65efd..947db2c1d4e 100644 --- a/doc/administration/redis/troubleshooting.md +++ b/doc/administration/redis/troubleshooting.md @@ -113,15 +113,19 @@ To make sure your configuration is correct: redis.info ``` - Keep this screen open and try to simulate a failover below. + Keep this screen open, and proceed to trigger a failover as described below. -1. To simulate a failover on primary Redis, SSH into the Redis server and run: +1. To trigger a failover on the primary Redis, SSH into the Redis server and run: ```shell # port must match your primary redis port, and the sleep time must be a few seconds bigger than defined one redis-cli -h localhost -p 6379 DEBUG sleep 20 ``` + WARNING: + This action affects services, and takes the instance down for up to 20 seconds. If successful, + it should recover after that. + 1. Then back in the Rails console from the first step, run: ```ruby |