# sentinel down-after-milliseconds <master-name> <milliseconds><br>#<br># Number of milliseconds the master (or any attached【所依附的】 slave or sentinel) should<br># be unreachable (as in, not acceptable reply to PING, continuously, for the<br># specified period) in order to consider it in S_DOWN state (Subjectively<br># Down).<br># 这段的意思是sentinel在和master【注意:不仅仅是master,还有slave、sentinel】失联多少毫秒后,可以做出主节点S_DOWN的判断。<br># 此参数的作用范围不仅仅是 sentinel到master的连接;还有sentinel到slave的连接;sentinel到sentinel的连接。<br># Default is 30 seconds.<br><br><em id="__mceDel" ><em id="__mceDel"><em id="__mceDel"><em id="__mceDel"><em id="__mceDel"><em id="__mceDel"><em id="__mceDel">sentinel down-after-milliseconds mymaster 30000</em></em></em></em></em></em></em>
复制代码
换句话说
down-after-milliseconds is the time in milliseconds an instance should not be reachable (either does not reply to our PINGs or it is replying with an error) for a Sentinel starting to think it is down.
2. parallel-syncs
# How many slaves we can reconfigure to point to the new slave simultaneously【同时】
# during the failover. Use a low number if you use the slaves to serve query
# to avoid that all the slaves will be unreachable at about the same
# time while performing the synchronization with the master.<br>##如果想在failover期间,slave同步新master的这个过程中,仍然想有部分slave 可以提供查询服务,那么可以将这个<br>##值设置小一点。【需要注意的是,这样带来的坏处就是:提供的查询服务,不保证数据的一致性,和主节点是有数据差异的;<br>##此外,faiover的master 和 所有slave的数据同步过程被拉长了】
sentinel parallel-syncs mymaster 1
复制代码
parallel-syncs sets the number of replicas that can be reconfigured to use the new master after a failover at the same time. The lower the number, the more time it will take for the failover process to complete, however if the replicas are configured to serve old data, you may not want all the replicas to re-synchronize with the master at the same time. While the replication process is mostly non blocking for a replica, there is a moment when it stops to load the bulk data from the master. You may want to make sure only one replica at a time is not reachable by setting this option to the value of 1.
3.failover-timeout
Moreover Sentinels have a rule: if a Sentinel voted another Sentinel for the failover of a given master, it will wait some time to try to failover the same master again. This delay is the 2 * failover-timeout you can configure in sentinel.conf. This means that Sentinels will not try to failover the same master at the same time, the first to ask to be authorized will try, if it fails another will try after some time, and so forth.
指定故障转移的超时时间,默认时间为3分钟。该超时时间的用途有很多:
由于第一次故障转移失败,在同一个master上进行第二次故障转移实验的时间为gai值的两倍。
新master提升完毕,slave从老master强制移到新master进行数据同步的时间阈值。
取消正在进行的故障转移所需的时间阈值。
新master提升完毕,所有的replicas的配置文件更新为新master的时间阈值。
《High availability with Redis Sentinel》
https://redis.io/docs/latest/operate/oss_and_stack/management/sentinel/