Designing High Availability for Redis Using Sentinel
This article explains how Redis Sentinel provides high‑availability for Redis clusters by monitoring masters and slaves, automatically failing over to a new master, and offering three methods for receiving failover notifications, while recommending an indirect‑service approach for scalable integration.
Redis Sentinel is the official high‑availability solution for Redis clusters, providing monitoring, notification, automatic failover and configuration provisioning.
The sentinel.conf file defines the monitored master, down‑after‑milliseconds, failover‑timeout and parallel‑syncs parameters, and Sentinel is started with redis-sentinel sentinel.conf.
After startup Sentinel periodically checks the master, pings all Redis instances and publishes status messages. It is recommended to run at least three Sentinel instances and require a quorum of two for failover.
Failover notifications can be received in three ways: (1) a notification script configured with sentinel notification-script mymaster /var/redis/notify.sh and a client‑reconfig script with
sentinel client-reconfig-script mymaster /var/redis/notifyReconfig.sh; (2) direct client subscription to Sentinel’s Pub/Sub channels such as "+slave"; (3) an intermediate service that subscribes to Sentinel and forwards events to application APIs, reducing coupling and improving scalability.
The article recommends the third, indirect‑service approach and shows a flow diagram. It also points to the official Sentinel documentation and a GitHub project for reference.
In summary, Sentinel offers a lightweight, low‑cost high‑availability option for Redis, suitable when resources are limited, while larger deployments may still prefer ZooKeeper.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Top Architect
Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
