keepalived的weight

1. weight 大于0

如果脚本监测失败,优先级不变,如果成功,优先级增加,如果后续监测失败,则优先级在增加的基础上回退,这个weight不会持续增加或减小,只会存在两个值

2. weight 小于0

如果脚本监测失败,优weight先级降低,如果成功,优先级不变,这个weight不会持续增加或减小,keepalive生命周期函数只会存在两个值

另外,keepalived启动时,不论rlinux创建文件ise和fall的设置的是多少,首次监测脚本,都keepalived安装与配置会根据上面的原则调整,后续的调整则要只有在进入fall和rise到达之后linux常用命令才会调整

       The  default  weight equals 0, which means that any VRRP instance moni-
toring the script will transition to the fault state after <fall>
consecutive failures of the script. After that, <rise> consecu-
tive successes will cause VRRP instances to leave the fault state,
unless they are also in the fault state due to other scripts or inter-
faces that they are tracking.

A positive weight means that <rise> successes will add
<weight> to the priority of all VRRP instances which monitor it.
On the opposite, a negative weight will be subtracted from the initial
priority in case of <fall> failures.

https://www.fons.com.cn/tag/%e5%8f%82%e8%80%83" target="_blank">参考:​​https://www.keepalived.org/manpage.html​​