redis-sentinel

redis sentinel is used to achieve high availability solution, the state designated sentinel by deploying a cluster, the cluster is responsible for monitoring sentinel redis master and slave, and automatically switch between them when master hanging from the master, thus ensuring high availability cache service.

So sentinel is how to achieve it?

1, sentinel designated start time will need to be monitored redis master, to note here, you are not required to specify redis slave, because the sentinel can check it by all the slave master.

2, the timing will then want all sentinel redis master, slave transmits the ping command, redis master, the slave receives a ping pong reply command, to the sentinel is determined according redis master, slave is in the normal state.

3, when a period of time (which may be configured, typically 30s) is redis master receives no reply, it is considered redis master Sentinel hanging and redis master subjective offline flag (also corresponding objective subsequent offline) .

4, when it exceeds a specified threshold are considered sentinel hang redis Master, a leader sentinel will be selected to handle the redis from the switching master.

5, choose a new data retention redis slave, set it to mater, and the other redis slave master to the new master.

 

sentinel possible problems:

1, redis because the master-slave synchronization is asynchronous way, so when the time from the occurrence of the main switch or may cause data loss.

 

Guess you like

Origin www.cnblogs.com/lit10050528/p/11456698.html