Solaris SVM的majority consensus算法
SVM的state database中包含了卷的配置和狀態(tài)等重要信息,一旦state database全部損壞,理論上將丟失卷上的所有數(shù)據(jù)。為了保證state database的安全,SVM使用了冗余機制。即維護多個state database replica.
在有多個state database replica的情況下,如果部分replica損壞,SVM難以判斷究竟哪些是好的,哪些是壞的。為了解決這個問題,SVM采用了majority consensus算法。即:當多于半數(shù)的replica可用且一致,則認為這些replica是有效的。
The majority consensus algorithm provides the following:
The system continues to run if at least half of the state database replicas are available.
The system panics if fewer than half of the state database replicas are available.
The system cannot reboot into multiuser mode unless a majority (half + 1) of the total number of state database replicas is available. If insufficient state database replicas are available, you must boot into single-user mode and delete enough of the corrupted or missing replicas to achieve a quorum.
從上述機制可以看出,如果半數(shù)或以上replica不可用,將導致Solaris無法啟動到多用戶模式下。此時解決辦法是啟動到單用戶下,然后刪除損壞的replica.
另一種解決方法是事先在/etc/system中設置set md:mirrored_root_flag = 1,此參數(shù)將讓SVM在啟動時忽略Quorum規(guī)則。但文檔明確說明,Solaris不建議修改此參數(shù),因為忽略Quorum規(guī)則的話,無法保證replica是有效的,因而無法確保卷的配置信息和狀態(tài)信息準確,這意味著卷中的數(shù)據(jù)有損壞或丟失的風險。
|