Need to migrate your e-mails to a new server? Free and paid versions of our online tool available.
Hero Image

Redis Sentinel (HA) on OpenBSD 7.5

Redis Sentinel (HA) on OpenBSD 7.5

Architecture

  • Primary 192.168.1.10:6379
  • Replica 192.168.1.11:6379, 192.168.1.12:6379
  • Sentinels on port 26379 (all 3 nodes)

Primary redis.conf

bind 0.0.0.0
requirepass RedisPass!

Replica redis.conf

bind 0.0.0.0
requirepass RedisPass!
replicaof 192.168.1.10 6379
masterauth RedisPass!

Sentinel config (/etc/redis/sentinel.conf)

port 26379
sentinel monitor myprimary 192.168.1.10 6379 2
sentinel auth-pass myprimary RedisPass!
sentinel down-after-milliseconds myprimary 5000
sentinel failover-timeout myprimary 60000
sentinel parallel-syncs myprimary 1

Start sentinels

redis-sentinel /etc/redis/sentinel.conf &

Test failover

redis-cli -p 26379 sentinel masters
redis-cli -h 192.168.1.10 -p 6379 -a RedisPass! DEBUG sleep 30
# Sentinel promotes a replica within ~10 s