45 lines
1.9 KiB
YAML
45 lines
1.9 KiB
YAML
|
|
# redis_sentinel defaults — Redis 7 + Sentinel co-located across 3
|
||
|
|
# Incus containers (redis-1 master at first boot, redis-2/redis-3
|
||
|
|
# replicas; one Sentinel per container = quorum 2 out of 3).
|
||
|
|
---
|
||
|
|
redis_version: "7" # apt provides 7.x on Ubuntu 22.04
|
||
|
|
redis_master_name: "veza-master"
|
||
|
|
redis_port: 6379
|
||
|
|
redis_sentinel_port: 26379
|
||
|
|
|
||
|
|
# Replication / persistence — sane prod defaults. AOF on for durability,
|
||
|
|
# RDB snapshot still kept for fast restore.
|
||
|
|
redis_aof_enabled: true
|
||
|
|
redis_save_config: "3600 1 300 100 60 10000"
|
||
|
|
|
||
|
|
# Sentinel quorum — number of sentinels that must agree before declaring
|
||
|
|
# the master down. With 3 sentinels, quorum=2 tolerates one sentinel
|
||
|
|
# crash. Don't lower below 2 in prod, ever.
|
||
|
|
redis_sentinel_quorum: 2
|
||
|
|
|
||
|
|
# Failover thresholds — match Day 11 acceptance criterion (< 30s).
|
||
|
|
# down-after-milliseconds: how long a master must be unreachable before
|
||
|
|
# a sentinel marks it as subjectively down.
|
||
|
|
# failover-timeout: max time to wait for replica promotion + reconfig
|
||
|
|
# before another failover can be triggered.
|
||
|
|
redis_sentinel_down_after_ms: 5000 # 5s = sentinel quorum decision in ~6-7s
|
||
|
|
redis_sentinel_failover_timeout_ms: 30000 # 30s budget for the whole flip
|
||
|
|
|
||
|
|
# Auth — required in prod (the Sentinel API can re-route traffic, so
|
||
|
|
# unauth'd Sentinel = security hole). Override via Vault.
|
||
|
|
redis_password: "CHANGE_ME_VAULT"
|
||
|
|
redis_sentinel_password: "CHANGE_ME_VAULT_SENTINEL"
|
||
|
|
|
||
|
|
# bind / protected-mode — bind to the Incus bridge IP only (10.0.x.y).
|
||
|
|
# protected-mode is OFF because we set bind explicitly + auth is on.
|
||
|
|
redis_bind: "0.0.0.0"
|
||
|
|
redis_protected_mode: "no"
|
||
|
|
|
||
|
|
# Resource caps — overall memory limit + eviction policy. The eviction
|
||
|
|
# policy `allkeys-lru` is intentionally non-zero-data-loss : presence
|
||
|
|
# keys, sessions, rate-limit counters are all OK to evict under
|
||
|
|
# pressure. If we add cache lines that MUST persist we'll need a second
|
||
|
|
# DB with `noeviction`.
|
||
|
|
redis_maxmemory: "1gb"
|
||
|
|
redis_maxmemory_policy: "allkeys-lru"
|