Redis learning clusters articles ---- Sentinel Sentinel

Sentinel Sentinel
Sentinel: Redis in high availability, automatic switch over the primary, Redis Sentinel clusters can be seen as a zookerper cluster, is the heart of a cluster of high availability
Sentinel main work:
responsible for continuous monitoring of health from the master node if the primary node hang will be re-select a new master node (selected from an optimal node)
connected client step:
client -----> sentinel cluster ------> query master address by sentinel ----- > connect the main nodes and data exchange
when the sentinel node will be informed of the latest primary when the primary node fails the client
after the main sentinel node will be adjusted after the failure to elect a new primary node, and will continue to monitor the primary node failure, recovery to re-establish relationship changed from node
1, the message is lost
Redis in master-slave asynchronous replication, it will hang after the master node may not fully receive all the synchronization message from the node
through a smaller reduction of the main messages from the delay loss: setting options
min-slaves-to-write 1 may have at least one node from normal replication, replication stops foreign service
min-slaves-max-lag 10 10s did not receive Slave node, it means that the node is not synchronized correctly
2, Sentinel basic usage
start mode: profile must bring
[the root @ localhost the src] # Redis-Sentinel /redis-5.0.4/sentinel.conf
[the root @ localhost the src] # redis-server /redis-5.0.4/sentinel.conf --sentinel
#sentinel configuration name for the mymaster
69 127.0.0.1 mymaster sentinel Monitor 6379 2
70 60 000 #sentinel heartbeat time has not come back sentinel considered unavailable master
71 is sentinel Dow-After-60,000 milliseconds mymaster
73 is sentinel failover-timeout mymaster 180000
74 # there can specify the maximum number of simultaneous new master slave synchronization
75 sentinel paraller-syncs mymaster 1

sentinel for determination unavailable
called subjective unavailable (SDOWN): sentinel own detecting sentinel unavailable
Also called objective unavailable (ODOWN): requires a certain amount of sentinel agree to consider a master objectively already shoot down
sentinel of among other sentinel detection result obtained by the command of the master SENTINEL is_master_down_by_addr.

Sentinel node from the primary display
Represents the master node: 25139: X 04 May 2019 20 : 57: 58.815 # + monitor master mymaster 127.0.0.1 6379 quorum 2
represents the slave node: 25139: X 04 May 2019 20 : 58: 18.892 * + reboot slave 127.0.0.1:6381 127.0.0.1 6381 @ mymaster 127.0.0.1 6379
represents the slave node: 25139: X 04 May 2019 20 : 58: 18.892 * + reboot slave 127.0.0.1:6380 127.0.0.1 6380 @ mymaster 127.0.0.1 6379
when the primary node is turned off ( subjective unavailable):
25 139: the X-04 May 2019 21: 01: 35.101 + SDOWN Master mymaster 127.0.0.1 # 6379

Guess you like

Origin blog.csdn.net/alvin_666/article/details/89737207