Illustrative WIUNIX Academy IT engineering workspace with server/network equipment and an instructional board: Set up Redis Sentinel high availability on Ubuntu and Debian

WIUNIX ACADEMY

Redis and Valkey Sentinel high availability on Linux

Build one active Redis primary, two passive replicas and three independent Sentinel voters. Verify replication, discovery, controlled failover and safe recovery.

Advanced75 min readUpdated
Make this guide yours

YOUR SYSTEM. YOUR STEPS.

Where are you working?

Choose your OS and version. The prerequisites, commands and troubleshooting follow your environment.

AlmaLinux 9.8Reviewed against official documentation ·

USE YOUR OWN VALUES

Configure this tutorial

Set the example values for your environment; related explanations and copy panels update together. Never enter passwords, private keys or tokens. Values stay in this tab and are not sent to the server or share links. Check actual DNS, certificates and network policy before running commands.

Different IP addresses, domains or ports? Open the settings below, change the values and select “Apply to tutorial”, then copy the updated commands.

Set values for my environment5 editable values

THE OUTCOME

What will you have at the end?

A three-node Redis/Sentinel group with mutual TLS, separate ACL identities, proven receiver data, controlled service failover and a data-preserving recovery path.

01A: initial primaryData + Sentinel; failure domain 1
02B: read-only replicaData + Sentinel; failure domain 2
03C: read-only replicaData + Sentinel; failure domain 3
Supported operating systems and versions

Reviewed 2026-11-05 against official documentation and read-only package payloads; not full installations across distributions. DEB uses Redis, RPM/rolling paths explicitly use Valkey on fresh disposable VMs, never a silent migration. Historical Redis 7.0.15 same-host namespace evidence covers mTLS/ACLs, replication, service-loss election and isolated RDB restore; it does not establish Valkey execution, native systemd/firewalls, real application reconnects or independent failure domains. Photographs are generated teaching scenes.

Before you begin

  • Three fresh systemd hosts on one reviewed OS/package version; existing sudo/SSH, assigned private IPs, synchronized clocks and independent failure domains.
  • Existing default-deny network policy, an approved client host, a protected secret manager and an existing deployment-specific CA with unique dual-purpose node certificates plus independent client certificate.
  • No existing Redis/Valkey data or application writers; enough RAM/disk for persistence and backups. Backup/recovery host has same-version Redis and root network-namespace capability.
  • The administrator image must already provide Bash, ip/ss, systemctl, tar and sudo; missing baseline tools stop preflight.

One active writer, two passive copies

Use three dedicated fresh hosts: A 10.20.0.10, B 10.20.0.11 and C 10.20.0.12. Each runs Redis on TLS 6379 and Sentinel on TLS 26379. A starts as primary; B and C start as read-only replicas. The group name academy stays stable as the primary changes. Put the three Sentinel voters in three independent failure domains: three processes on one machine, or three VMs on one hypervisor, do not provide three independent domains. This is a single dataset, not Redis Cluster sharding or active-active writes.

Quorum, majority and the cost of availability

Quorum 2 means two Sentinels must report the primary down before objective-down detection. A failover leader also needs authorization from a majority of all known Sentinels: two of three in this topology. One surviving voter cannot promote safely. Replication is asynchronous: acknowledged writes can disappear after promotion, and replicas can return stale reads. WAIT measures replica acknowledgements on the same connection; it does not turn Sentinel into a consensus database or guarantee durable commits. AOF everysec may lose recent local writes on a crash. Sentinel is neither fencing nor a backup.

Fresh hosts only; settle trust and routing first

Use only fresh disposable dedicated VMs with no existing Redis/Valkey installation or dataset. A guard failure means stop, never delete state to pass. Keep one selected OS, product and exact package version across A/B/C. Before starting services, use your existing default-deny firewall/security group to permit TCP 6379 only among A/B/C and approved application/admin clients, and TCP 26379 only among A/B/C and approved discovery/admin clients. Preserve restricted SSH. Neither service is public, and NAT port remapping is outside this topology.

Upstream releases, distro maintenance and licensing

Ubuntu/Debian use distribution Redis; the RHEL/Rocky/Alma and Arch/Manjaro paths deliberately use distribution Valkey, a separate product with shared ancestry and compatible protocols. Use the same product and exact package release on all three fresh disposable VMs. This is not an existing-data migration; compatibility aliases named redis-server do not identify the backend.

Reviewed 2026-11-05: upstream Redis security policy excludes 8.0 and 7.0; vendor backports have a separate lifecycle. Verify actual signed-package security coverage before real deployment, including Ubuntu Universe/Pro and Debian 12 LTS scope. Redis 7.0 uses BSD-3-Clause, Redis 8 offers AGPLv3/RSALv2/SSPLv1, and Valkey uses BSD; inspect the installed package license and your obligations. No optional module stack is installed.

01

LET’S BUILD

Inspect all three fresh nodes

On A/B/C in Bash as the existing sudo administrator. Confirm the selected OS, assigned private IP, clock synchronization, at least 2 GB RAM and space for three data copies, AOF rewrites and retained backups. Investigate any listener on 6379/26379. An unregistered manually installed server can escape the package check: inspect running processes/listeners too.

Bash
(
set -euo pipefail
. /etc/os-release
printf '%s %s\n' "$ID" "$VERSION_ID"
uname -m
ip -br address
timedatectl status
df -h / /var
installed=$(rpm -qa --qf '%{NAME}\n')
if printf '%s\n' "$installed" | grep -E '^(redis|redis[0-9]*|valkey|valkey-compat-redis)$' >/dev/null; then
  echo 'Existing Redis/Valkey installation: STOP' >&2; exit 1
fi
for path in /etc/redis /etc/redis.conf /var/lib/redis /etc/valkey /var/lib/valkey; do
  if sudo test -e "$path" || sudo test -L "$path"; then echo "Existing state: $path; STOP" >&2; exit 1; fi
done
sudo ss -lntp
ps -eo pid,user,args | grep -E '[r]edis|[v]alkey' || true
)
How do I know it worked?

All nodes are fresh and the selected private network is assigned.

02

LET’S BUILD

Install matching distribution packages

On three fresh guarded VMs, install Valkey 8.0 from standard EL 10.2/9.8 signed AppStream; older EUS or a Redis module is not this path. No third-party repository is needed. Compare actual security updates and exact package versions.

Bash
sudo dnf install valkey openssl nano iproute util-linux policycoreutils-python-utils
rpm -q valkey
/usr/bin/valkey-server --version
/usr/bin/valkey-sentinel --version
/usr/bin/valkey-cli --version
systemctl show valkey valkey-sentinel -p User -p Group -p ExecStart
How do I know it worked?

Redis and Sentinel versions match on all three nodes; no unauthenticated package source is used.

Explore all tutorials ↗