Solaris SVM的majority consensus算法
SVM的state database中包含了卷的配置和状态等重要信息,一旦state database全部损坏,理论上将丢失卷上的所有数据。为了保证state database的安全,SVM使用了冗余机制。即维护多个state database replica.
在有多个state database replica的情况下,如果部分replica损坏,SVM难以判断究竟哪些是好的,哪些是坏的。为了解决这个问题,SVM采用了majority consensus算法。即:当多于半数的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.
从上述机制可以看出,如果半数或以上replica不可用,将导致Solaris无法启动到多用户模式下。此时解决办法是启动到单用户下,然后删除损坏的replica.
另一种解决方法是事先在/etc/system中设置set md:mirrored_root_flag = 1,此参数将让SVM在启动时忽略Quorum规则。但文档明确说明,Solaris不建议修改此参数,因为忽略Quorum规则的话,无法保证replica是有效的,因而无法确保卷的配置信息和状态信息准确,这意味着卷中的数据有损坏或丢失的风险。
|