Skip to content

Commit

Permalink
Add basic Redis Sentinel documentation (#1311)
Browse files Browse the repository at this point in the history
* Add basic Redis Sentinel documentation

Co-authored-by: Andy Piper <[email protected]>
  • Loading branch information
gmemstr and andypiper authored Dec 11, 2023
1 parent a625f3f commit 3712250
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
36 changes: 36 additions & 0 deletions content/en/admin/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,42 @@ Defaults to the value of `REDIS_NAMESPACE`.

#### `SIDEKIQ_REDIS_URL`

#### `REDIS_SENTINEL`

Either a single DNS name that resolves one or more A records for [Redis Sentinel](https://redis.io/docs/management/sentinel/), or a comma-delimited list of Redis Sentinel instance IP:PORTs.

#### `REDIS_SENTINEL_MASTER`

The name of the Redis Sentinel master to connect to, defaults to `mymaster`.

#### `REDIS_SENTINEL_PORT`

If using the DNS name approach for `REDIS_SIDEKIQ_SENTINEL`, defines the port to use to connect to the instances resolved. Defaults to `26379`.

#### `CACHE_REDIS_SENTINEL`

Either a single DNS name that resolves one or more A records for [Redis Sentinel](https://redis.io/docs/management/sentinel/), or a comma-delimited list of Redis Sentinel instance IP:PORTs.

#### `CACHE_REDIS_SENTINEL_MASTER`

The name of the Redis Sentinel master to connect to, defaults to `mymaster`.

#### `CACHE_REDIS_SENTINEL_PORT`

If using the DNS name approach for `CACHE_REDIS_SENTINEL`, defines the port to use to connect to the instances resolved. Defaults to `26379`.

#### `SIDEKIQ_REDIS_SENTINEL`

Either a single DNS name that resolves one or more A records for [Redis Sentinel](https://redis.io/docs/management/sentinel/), or a comma-delimited list of Redis Sentinel instance IP:PORTs.

#### `SIDEKIQ_REDIS_SENTINEL_MASTER`

The name of the Redis Sentinel master to connect to, defaults to `mymaster`.

#### `SIDEKIQ_REDIS_SENTINEL_PORT`

If using the DNS name approach for `SIDEKIQ_REDIS_SENTINEL`, defines the port to use to connect to the instances resolved. Defaults to `26379`.

### Elasticsearch {#elasticsearch}

{{< page-ref page="admin/elasticsearch" >}}
Expand Down
5 changes: 5 additions & 0 deletions content/en/admin/scaling.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,11 @@ systemctl restart mastodon-web.service
systemctl restart redis-sidekiq.service
```


## Redis Sentinel for High Availability {#redis-sentinel}

As mentioned, Redis is a critical part of a Mastodon instance's operation. By default, your deployment will use a single Redis instance, or multiple if you've setup a cache. However if that instance goes down it can bring the entire Mastodon instance down as well. To alleviate this, Redis Sentinel can be used to track your Redis instances and automatically direct clients to a new primary if one goes down. You can specify `REDIS_SENTINEL`, which is either a DNS name that resolves to the IPs of your Redis Sentinel instances (e.g a Kubernetes service) or a comma-delimited list of the IP:Port combinations directly, that Mastodon can talk with to determine the current master Redis node. By default Sentinel will set an instance as down and select a new master after a minute of the current master being unreachable, but this can be configured based on your setup.

## Read-replicas {#read-replicas}

To reduce the load on your PostgreSQL server, you may wish to set up hot streaming replication (read replica). [See this guide for an example](https://cloud.google.com/community/tutorials/setting-up-postgres-hot-standby). You can make use of the replica in Mastodon in these ways:
Expand Down

1 comment on commit 3712250

@vercel
Copy link

@vercel vercel bot commented on 3712250 Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.