Setting up Sentinel
Redis Sentinel, as the name implies, acts as a guard for the Redis master and slave instances. One Sentinel is obviously not enough to guarantee high availability because a single Sentinel itself is also subject to failure. Because the master failover decision is based on a quorum system, at least three Sentinel processes are required as a robust distributed system that keeps monitoring the status of the Redis master data server. If multiple Sentinel processes detect that the master is down, one of the Sentinel process will be elected to promote a slave to replace the old master. With proper configuration, the entire process is automatic without any human intervention. In this recipe, we will demonstrate how to set up a simple environment of one master and two slaves, which is monitored by three Sentinels.
Getting ready…
You need to set up one Redis master server and two slave servers. You can refer to the Setting up Redis replication section in Chapter 6, Persistence for...