Redis Sentinel Failover¶
Redis Sentinel Failover is the process by which a Redis Sentinel system automatically promotes a replica to the role of master when the primary master node fails.^[400-devops-09-scripting-language-golang-introduction-part-5databaseredis-readme.md]
Architecture¶
A typical Sentinel setup involves a master, several replicas, and a minimum of three Sentinel processes.^[400-devops-09-scripting-language-golang-introduction-part-5databaseredis-readme.md] Sentinels monitor the state of the Redis instances, performing tasks such as monitoring, notification, and automatic failover.^[400-devops-09-scripting-language-golang-introduction-part-5databaseredis-readme.md] The specific master instance being monitored is identified by a configurable alias, often set to mymaster.^[400-devops-09-scripting-language-golang-introduction-part-5databaseredis-readme.md]
Client Configuration¶
To connect to a Redis setup managed by Sentinel, client applications—such as those written in Go—use a Sentinel Client (or Failover Client).^[400-devops-09-scripting-language-golang-introduction-part-5databaseredis-readme.md]
Instead of connecting directly to a static IP address, the client configures itself with the following parameters^[400-devops-09-scripting-language-golang-introduction-part-5databaseredis-readme.md]:
- Sentinel Addresses: A list of host:port pairs for the Sentinel nodes (e.g.,
sentinel-0:5000,sentinel-1:5000). - Master Name: The alias (e.g.,
mymaster) used to identify the current master. - Password: The authentication password for the Redis nodes.
This configuration allows the application to remain resilient to changes in topology, as the client queries the Sentinels to find the current master address.^[400-devops-09-scripting-language-golang-introduction-part-5databaseredis-readme.md]
Related Concepts¶
- [[Redis]]
- [[High Availability]]
- [[Docker Networking]]
Sources¶
^[400-devops-09-scripting-language-golang-introduction-part-5databaseredis-readme.md]