有些时候,有些判断是无法做到真实,但是能做到最优也不错了
来源:互联网 发布:mac怎么保存文档 编辑:程序博客网 时间:2024/06/06 03:45
有些时候,有些判断是无法做到真实,但是能做到最优也不错了
比如
redis cluster的配置参数cluster-slave-validity-factor就运用了这种思维:
A slave of a failing master will avoid to start a failover if its data
looks too old.
There is no simple way for a slave to actually have a exact measure of
its “data age”, so the following two checks are performed:
1) If there are multiple slaves able to failover, they exchange messages
in order to try to give an advantage to the slave with the best
replication offset (more data from the master processed).
Slaves will try to get their rank by offset, and apply to the start
of the failover a delay proportional to their rank.
2) Every single slave computes the time of the last interaction with
its master. This can be the last ping or command received (if the master
is still in the “connected” state), or the time that elapsed since the
disconnection with the master (if the replication link is currently down).
If the last interaction is too old, the slave will not try to failover
at all.
The point “2” can be tuned by user. Specifically a slave will not perform
the failover if, since the last interaction with the master, the time
elapsed is greater than:
(node-timeout * slave-validity-factor) + repl-ping-slave-period
So for example if node-timeout is 30 seconds, and the slave-validity-factor
is 10, and assuming a default repl-ping-slave-period of 10 seconds, the
slave will not try to failover if it was not able to talk with the master
for longer than 310 seconds.
A large slave-validity-factor may allow slaves with too old data to failover
a master, while a too small value may prevent the cluster from being able to
elect a slave at all.
For maximum availability, it is possible to set the slave-validity-factor
to a value of 0, which means, that slaves will always try to failover the
master regardless of the last time they interacted with the master.
(However they’ll always try to apply a delay proportional to their
offset rank).
Zero is the only value able to guarantee that when all the partitions heal
the cluster will always be able to continue.
延伸
NP问题(Non-Deterministic Polynomial Complete Problems)
- 有些时候,有些判断是无法做到真实,但是能做到最优也不错了
- 偶,也能做到
- 虽然做不到全部,能做到其中几条也不错了
- iphone能做到的android也能做到
- 有些时候
- 来CSDN也算是有些年头了
- 不用数学也能讲清贝叶斯理论的马尔可夫链蒙特卡洛方法?这篇文章做到了
- 不用数学也能讲清贝叶斯理论的马尔可夫链蒙特卡洛方法?这篇文章做到了
- 第一次学习写博客。有些激动,希望自己的总结能够帮助到别人,也希望自己日后总结时能够做到提醒自己。
- tomcat的startup.bat启动后隐藏,可以做到吗?因为有些时候大部分人都有强迫症,看见窗口就想关掉,或者可能会一不小心关掉
- 这几天有些闲了,但是心却紧了
- 有些。
- 有些写法是正确的,但是为什么报错,mybaits
- 如果有些东西能引起我的思考,哪怕是一秒钟,我也要记下来
- 悲观者的力量:我也能做到
- 全局修改默认字体,通过反射也能做到
- 啥时候能做到像编译器一样了解C++?
- 没钱也能上京东头条-《老码说编程之玩转Swift江湖》一书做到了
- 一个小程序
- 用户信用卡系统
- 感性认识spring的IoC
- PL/SQL 显式游标
- offsetHeight、offsetWidth、clientWidth、clientHeight无法获取值得问题
- 有些时候,有些判断是无法做到真实,但是能做到最优也不错了
- 来谈谈SQL数据库中"简单的"SELECT TOP—可能有你从未注意到的细节
- JAVA动态代理的理解(转载)
- poj 2485 prim入门题目
- 杭电oj(Java版)——1720 A+B Coming
- CSS样式的优先级
- 粉丝经济新时代来临,商虫云微信群控系统的商机你看到...
- tp ajax 搜索分页
- XZ_iOS之app分享到QQ或者微信,然后点击分享链接调起app