Load-Balancing

為什麼keepalived需要狀態

  • October 10, 2012

從文件

! 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) 

那麼為什麼要定義一個狀態而不是僅僅使用優先級呢?

這只是為了允許更快的啟動。如果您有一個節點以主模式啟動,而其他節點以備份模式啟動,那麼事情將立即按照您想要的方式執行。另一種選擇是讓兩個節點都以主模式啟動,或者兩個節點都以備份模式啟動,在這種情況下,直到節點確定它們是唯一的操作節點,事情才會正常工作。

引用自:https://serverfault.com/questions/436731