如何理解SunCluster的quorum
1,226 Views『作者:RickyZhu 转载务必注明出处和作者』
Tag:rac, solaris
如何更好的理解SunCluster的Quorum,也就是选举盘,下面就结合例子做介绍。
其实说到底就是两个公式:
一个是计算选举盘是否足够的公式:
Q=TCV/2+1
TCV就是当前cluster中配置的总票数,Toally configured Votes.
至于如何计算总票数,就是第二个公式了:
TCV=node 票数+device 票数
node票数很容易计算,每个节点一票
device票数计算方法是:
QD=TCD-1
TCD就是连接当前共享设备的所有的节点数-1
下面是详细的说明:
To form a cluster and offer services, the nodes in a cluster must first reach quorum. The quorum equation states that a cluster must have the total number of configured votes, divided by two (remainders are discarded), plus one (Q = TCV/2 + 1). If a cluster cannot reach quorum, then it does not form. The individual cluster nodes do not boot fully, but wait until enough votes are available to reach quorum. If a running cluster loses quorum, the affected nodes panic and try to reboot (assuming auto-boot? is set to true on those nodes). Machines can be booted outside the cluster by issuing a boot -x from the OBP, but no cluster services will be available on these machines.
The key to understanding quorum is learning how votes are assigned and counted. Each node in a configured cluster has one (1) quorum vote. Each shared storage device configured as a quorum device has votes totaling the number of connected devices minus one (QD = TCD - 1). Ownership of a quorum device is assigned to one controlling node based on SCSI reservations.
By doing some simple math, it’s easy to see that a two-node cluster must have a quorum device to continue operating if one node fails. Once installed, a two-node cluster under Sun Cluster must have a quorum device for this very reason.
Quorum required to operate:
Q = TCV/2 + 1 = (2)/2 + 1 = 2
Votes if one node fails: 1
When you introduce a quorum device, the equation changes. This Sun Cluster configuration, shown in the following figure, is one of the most common.

Quorum required to operate:
Q = (2 + 1)/2 + 1 = 2
Votes if one node fails: (1 + 1) = 2
Below are some quorum examples in more complex cluster configurations.

Note in the last example that the quorum device is connected to three devices (N) and therefore has two (N-1) votes. The same quorum formula still applies, though.
Quorum required to operate:
Q = (3 + 2)/2 + 1 = 3
Votes if one node fails: (2 + 2) = 4
Votes if two nodes fail: (1 + 2) = 3
Votes if just the QD fails: ( 1 + 1 + 1) = 3
Votes if any node plus the QD fails: (1 + 1) = 2
As a note of warning, when allocating quorum devices, always use the minimum number possible to achieve quorum, or the health of the cluster will depend on the health of the shared disks configured as quorum devices. In the case where only one of the configured quorum devices is necessary for cluster operation, the cluster will fail unnecessarily if one of the unneeded quorum devices fails. Also, never have the number of quorum device votes exceed the number of device votes, or you run the risk of enabling two separate clusters to form independently (which is known as “split brain”). In this case, both clusters will compete for traffic on the public network, and data between the two will be out of sync.
详细参考:
http://www.sun.com/bigadmin/features/articles/install_cluster.html
