为什么国家需要keepalived

从文档

! MASTER and BACKUP state are determined by the priority ! even if you specify MASTER as the state, the state will ! be voted on by priority (so if your state is MASTER but your ! priority is lower than the router with BACKUP, you will lose ! the MASTER state) 

那么为什么定义一个状态而不是仅仅使用优先级?

这只是为了更快启动。 如果您有一个节点在主模式下启动,而其他节点在备份中启动,则事情将按照您想要的方式立即运行。 另一种方法是让两个节点都以主模式启动,或者两个节点都以备份模式启动,在这种情况下,只有节点确定它们是唯一的操作节点,情况才能正常工作。