mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
documentation on redis sentinel
This commit is contained in:
parent
3538eeda14
commit
ba9a2956a8
@ -88,6 +88,48 @@ REDIS = {
|
|||||||
It is highly recommended to keep the webhook and cache databases separate. Using the same database number on the
|
It is highly recommended to keep the webhook and cache databases separate. Using the same database number on the
|
||||||
same Redis instance for both may result in webhook processing data being lost during cache flushing events.
|
same Redis instance for both may result in webhook processing data being lost during cache flushing events.
|
||||||
|
|
||||||
|
### Using Redis Sentinel
|
||||||
|
|
||||||
|
If you are using [Redis Sentinel](https://redis.io/topics/sentinel) for high-availability purposes, there is minimal
|
||||||
|
configuration necessary to convert NetBox to recognize it. It requires the removal of the `HOST` and `PORT` keys from
|
||||||
|
above and the addition of two new keys.
|
||||||
|
|
||||||
|
* `SENTINELS`: List of tuples or tuple of tuples with each inner tuple containing the name or IP address
|
||||||
|
of the Redis server and port for each sentinel instance to connect to
|
||||||
|
* `SENTINEL_SERVICE`: Name of the master / service to connect to
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```python
|
||||||
|
REDIS = {
|
||||||
|
'webhooks': {
|
||||||
|
'SENTINELS': [('mysentinel.redis.example.com', 6379)],
|
||||||
|
'SENTINEL_SERVICE': 'netbox',
|
||||||
|
'PASSWORD': '',
|
||||||
|
'DATABASE': 0,
|
||||||
|
'DEFAULT_TIMEOUT': 300,
|
||||||
|
'SSL': False,
|
||||||
|
},
|
||||||
|
'caching': {
|
||||||
|
'SENTINELS': [
|
||||||
|
('mysentinel.redis.example.com', 6379),
|
||||||
|
('othersentinel.redis.example.com', 6379)
|
||||||
|
],
|
||||||
|
'SENTINEL_SERVICE': 'netbox',
|
||||||
|
'PASSWORD': '',
|
||||||
|
'DATABASE': 1,
|
||||||
|
'DEFAULT_TIMEOUT': 300,
|
||||||
|
'SSL': False,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! note:
|
||||||
|
It is possible to have only one or the other Redis configurations to use Sentinel functionality. It is possible
|
||||||
|
for example to have the webhook use sentinel via `HOST`/`PORT` and for caching to use Sentinel via
|
||||||
|
`SENTINELS`/`SENTINEL_SERVICE`.
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## SECRET_KEY
|
## SECRET_KEY
|
||||||
|
Loading…
Reference in New Issue
Block a user