The Redis Sentinel mechanism (V)

What is the mechanism Sentinel

Redis sentinels (Sentinel) Redis system for managing a plurality of servers, the system performs the following three tasks:
· Monitoring (Monitoring): Sentinel (sentinel) will continue to check if your Master and Slave functioning properly.
Remind (Notification): When monitoring a Redis problems, Sentinel (sentinel) can send notifications to the administrator or other applications via the API.
Automatic failover (Automatic failover): When a Master does not work, Sentinel (sentinel) will start an automatic failover operation, it will be one of the Slave Master failure upgraded to the new Master, and let the failure of other Master copy to the new Master Slave; when the client tries to connect Master failure, the cluster will return to the client terminal address of the new Master of such cluster may be used in place of Master Master failure.
Sentinel (sentinel) is a distributed system, you can run multiple Sentry (sentinel) in a process architecture, these processes use rumors protocol (gossipprotocols) to receive information about whether the Master off the assembly line, and use the voting agreement (agreement protocols ) to decide whether to perform automatic failover, as well as the new select which Slave Master.
Each sentinel (Sentinel) will, master, slave timing of transmission to other Sentry (Sentinel) message to confirm whether the other "living", if it is found not to respond to each other (configurable) at the specified time, the time being that the other side has been linked (so-called "subjective view down" subjective Down, referred sdown).
If the "sentinel group" in the most sentinel, reported a master did not respond, the system was considered the master "completely dead" (ie: real down machine on objective, Objective Down, referred odown), through a certain algorithm vote, from the rest of the slave node, selected from a lift to master, and then automatically modify the configuration.
Although Sentinel (sentinel) released by the given --sentinel option when a single executable file redis-sentinel, but it is actually just a Redis server in a special mode of operation, you can start a general Redis server start Sentinel (sentinel).
Sentinel (sentinel) of some of the design ideas and is very similar zookeeper
Single Sentinel (Sentinel)
 
 

Sentinel modify the configuration mode

Implementation steps:
1. Copy etc directory to
cp sentinel.conf  /usr/local/redis/etc
2. Modify sentinel.conf profile
sentinel monitor mymast 192.168.110.133 6379 1 # master node name IP port number the number of election
3. Modify the heartbeat detection 5000 milliseconds
sentinel down-after-milliseconds mymaster 5000
4.sentinel parallel-syncs mymaster 2 --- how much more qualified to do node
5. Start Sentinel mode
./redis-server /usr/local/redis/etc/sentinel.conf --sentinel &
6. Stop mode Sentinel

Guess you like

Origin www.cnblogs.com/hzanyan/p/12001252.html