Mudanças entre as edições de "Criar QuorumDisk"

De Slacam_Wiki
Ir para: navegação, pesquisa
(Criou página com 'RHCS(Red Hat Cluster Suite) quorum disk The last post "RHCS I/O fencing" is about dealing with split-brain situation, in which cluster members lost heartbeat communication and ea…')
 
Linha 1: Linha 1:
RHCS(Red Hat Cluster Suite) quorum disk
+
=== RHCS(Red Hat Cluster Suite) quorum disk ===
The last post "RHCS I/O fencing" is about dealing with split-brain situation, in which cluster members lost heartbeat communication and each believe it is legitimate to write data to the shared storage.  
+
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; line-height: 1.6em; color: rgb(51, 51, 51); font-family: Verdana, serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); " id="post-body-1979843398346145118" class="post-body entry-content">The last post "[http://honglus.blogspot.com/2011/05/rhcsred-hat-cluster-suite-io-fencing.html RHCS I/O fencing]" is about dealing with split-brain situation, in which cluster members lost heartbeat communication and each believe it is legitimate to write data to the shared storage.<span class="Apple-converted-space">&nbsp;</span><br>'''Methods to deal with split-brain situation:<span class="Apple-converted-space">&nbsp;</span><br>'''1. Redundant heartbeat path<span class="Apple-converted-space">&nbsp;</span><br>network port communication plus serial port communication<span class="Apple-converted-space">&nbsp;</span><br>2. I/O fencing<span class="Apple-converted-space">&nbsp;</span><br>Remaining nodes separate failed node from its storage either by shutdown/reboot power port or storage port<span class="Apple-converted-space">&nbsp;</span><br>3. Quorum disk<span class="Apple-converted-space">&nbsp;</span><br>Quorum disk is a kind of I/O fencing, but the reboot action is executed by failed node's own quorum daemon. It also has<span class="Apple-converted-space">&nbsp;</span>'''additional feature''': contributing vote to cluster. if you want the last standing node to keep the multiple-nodes cluster&nbsp; running, quorum disk appears to be the only solution.<br>'''RHCS (Red Hat Cluster Suite) Quorum disk facts<span class="Apple-converted-space">&nbsp;</span><br>'''- A shared block device (SCSI/iSCSI/FC..), Device size requirement is approximately 10MiB<span class="Apple-converted-space">&nbsp;</span><br>- Supports maximum 16 nodes, nodes id must be sequentially ordered<span class="Apple-converted-space">&nbsp;</span><br>- Quorum disk can contribute&nbsp; votes. In multiple nodes cluster, together with quorum vote, the last standing node can still keep the cluster running<span class="Apple-converted-space">&nbsp;</span><br>- single node votes+1 &lt;=Quorum's disk vote &lt; nodes total votes<span class="Apple-converted-space">&nbsp;</span><br>- The failure of the shared quorum disk won’t result in cluster failure, as long as Quorum's disk vote &lt; nodes total votes<span class="Apple-converted-space">&nbsp;</span><br>- each node write its own health information in its own region, the health is determined by external checking program such as "ping"<br>'''Setup Quorum disk'''<br><pre>#initialise quorum disk once in any node  
Methods to deal with split-brain situation:  
+
mkqdisk -c /dev/sdx -l myqdisk </pre>'''Add quorum disk to cluster&nbsp;'''<br>Use luci or system-config-cluster to add quorum disk, following is the result xml file<br><pre style="background-color: rgb(251, 251, 251); border-bottom-color: rgb(206, 206, 206); border-bottom-width: 1px; border-bottom-style: solid; border-left-color: rgb(206, 206, 206); border-left-width: 1px; border-left-style: solid; border-right-color: rgb(206, 206, 206); border-right-width: 1px; border-right-style: solid; border-top-color: rgb(206, 206, 206); border-top-width: 1px; border-top-style: solid; min-height: 40px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 650px; "><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">&lt;clusternodes&gt;
1. Redundant heartbeat path  
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">&lt;clusternode name="<span style="color: rgb(139, 0, 0); ">station1.example.com</span>" nodeid="<span style="color: rgb(139, 0, 0); ">1</span>" votes="<span style="color: rgb(139, 0, 0); ">2</span>"&gt; </pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">&lt;fence/&gt;
network port communication plus serial port communication  
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">&lt;/clusternode&gt;
2. I/O fencing  
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">&lt;clusternode name="<span style="color: rgb(139, 0, 0); ">station2.example.com</span>" nodeid="<span style="color: rgb(139, 0, 0); ">2</span>" votes="<span style="color: rgb(139, 0, 0); ">2</span>"&gt; </pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">&lt;fence/&gt;
Remaining nodes separate failed node from its storage either by shutdown/reboot power port or storage port  
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">&lt;/clusternode&gt;
3. Quorum disk  
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">&lt;clusternode name="<span style="color: rgb(139, 0, 0); ">station3.example.com</span>" nodeid="<span style="color: rgb(139, 0, 0); ">3</span>" votes="<span style="color: rgb(139, 0, 0); ">2</span>"&gt; </pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">&lt;fence/&gt;
Quorum disk is a kind of I/O fencing, but the reboot action is executed by failed node's own quorum daemon. It also has additional feature: contributing vote to cluster. if you want the last standing node to keep the multiple-nodes cluster running, quorum disk appears to be the only solution.
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">&lt;/clusternode&gt;
RHCS (Red Hat Cluster Suite) Quorum disk facts  
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">&lt;/clusternodes&gt;
- A shared block device (SCSI/iSCSI/FC..), Device size requirement is approximately 10MiB  
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; "><span style="color: green; ">#expected votes =9=(nodes total votes + quorum disk votes) = (2+2+2+3)      </span> </pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">&lt;cman expected_votes="<span style="color: rgb(139, 0, 0); ">9</span>"/&gt; </pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; "><span style="color: green; ">#Health check result is writen to quorum disk every 2 secs</span> </pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; "><span style="color: green; ">#if health check fails over 5 tko, 10 (2*5) secs, the node is rebooted by quorum daemon</span> </pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; "><span style="color: green; ">#Each heuristic check is run very 2 secs and earn 1 score,if shell script return is 0</span> </pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">&lt;quorumd interval="<span style="color: rgb(139, 0, 0); ">2</span>" label="<span style="color: rgb(139, 0, 0); ">myqdisk</span>" min_score="<span style="color: rgb(139, 0, 0); ">2</span>" tko="<span style="color: rgb(139, 0, 0); ">5</span>" votes="<span style="color: rgb(139, 0, 0); ">3</span>"&gt; </pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">&lt;heuristic interval="<span style="color: rgb(139, 0, 0); ">2</span>" program="<span style="color: rgb(139, 0, 0); ">ping -c1 -t1 192.168.1.60</span>" score="<span style="color: rgb(139, 0, 0); ">1</span>"/&gt; </pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">&lt;heuristic interval="<span style="color: rgb(139, 0, 0); ">2</span>" program="<span style="color: rgb(139, 0, 0); ">ping -c1 -t1 192.168.1.254</span>" score="<span style="color: rgb(139, 0, 0); ">1</span>"/&gt; </pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">&lt;/quorumd&gt;</pre></pre>'''Start quorum disk daemon'''<br>The daemon is also one of daemons automatically started by cman<br><span style="font-family: monospace; white-space: pre; " class="Apple-style-span">service qdiskd start</span><br>'''Check quorum disk information'''<br><pre style="background-color: rgb(251, 251, 251); border-bottom-color: rgb(206, 206, 206); border-bottom-width: 1px; border-bottom-style: solid; border-left-color: rgb(206, 206, 206); border-left-width: 1px; border-left-style: solid; border-right-color: rgb(206, 206, 206); border-right-width: 1px; border-right-style: solid; border-top-color: rgb(206, 206, 206); border-top-width: 1px; border-top-style: solid; min-height: 40px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 650px; "><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">$ mkqdisk -L -d
- Supports maximum 16 nodes, nodes id must be sequentially ordered  
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">mkqdisk v0.6.0
- Quorum disk can contribute votes. In multiple nodes cluster, together with quorum vote, the last standing node can still keep the cluster running  
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">/dev/disk/by-id/scsi-1IET_00010002:
- single node votes+1 <=Quorum's disk vote < nodes total votes  
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">/dev/disk/by-uuid/55fbf858-df75-493b-a764-5640be5a9b46:
- The failure of the shared quorum disk won’t result in cluster failure, as long as Quorum's disk vote < nodes total votes  
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">/dev/sdc:
- each node write its own health information in its own region, the health is determined by external checking program such as "ping"
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Magic:                eb7a62c2
Setup Quorum disk
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Label:                myqdisk
#initialise quorum disk once in any node  
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Created:              Sat May  7 05:56:35 2011
mkqdisk -c /dev/sdx -l myqdisk  
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Host:                station2.example.com
Add quorum disk to cluster  
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Kernel Sector Size:  512
Use luci or system-config-cluster to add quorum disk, following is the result xml file
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Recorded Sector Size: 512
<clusternodes>
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Status block <span style="color: blue; ">for</span> node 1 </pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Last updated by node 1
<clusternode name="station1.example.com" nodeid="1" votes="2">
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Last updated on Sat May  7 15:09:37 2011
<fence/>
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">State: Master
</clusternode>
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Flags: 0000
<clusternode name="station2.example.com" nodeid="2" votes="2">
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Score: 0/0
<fence/>
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Average Cycle speed: 0.001500 seconds
</clusternode>
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Last Cycle speed: 0.000000 seconds
<clusternode name="station3.example.com" nodeid="3" votes="2">
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Incarnation: 4dc4d1764dc4d176
<fence/>
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Status block <span style="color: blue; ">for</span> node 2 </pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Last updated by node 2
</clusternode>
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Last updated on Sun May  8 01:09:38 2011
</clusternodes>
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">State: Running
#expected votes =9=(nodes total votes + quorum disk votes) = (2+2+2+3)       
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Flags: 0000
<cman expected_votes="9"/>  
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Score: 0/0
#Health check result is writen to quorum disk every 2 secs
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Average Cycle speed: 0.001000 seconds
#if health check fails over 5 tko, 10 (2*5) secs, the node is rebooted by quorum daemon
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Last Cycle speed: 0.000000 seconds
#Each heuristic check is run very 2 secs and earn 1 score,if shell script return is 0
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Incarnation: 4dc55e164dc55e16
<quorumd interval="2" label="myqdisk" min_score="2" tko="5" votes="3">
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Status block <span style="color: blue; ">for</span> node 3 </pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Last updated by node 3
<heuristic interval="2" program="ping -c1 -t1 192.168.1.60" score="1"/>
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Last updated on Sat May  7 15:09:38 2011
<heuristic interval="2" program="ping -c1 -t1 192.168.1.254" score="1"/>
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">State: Running
</quorumd>
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Flags: 0000
Start quorum disk daemon
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Score: 0/0
The daemon is also one of daemons automatically started by cman
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Average Cycle speed: 0.001500 seconds
service qdiskd start
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Last Cycle speed: 0.000000 seconds
Check quorum disk information
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Incarnation: 4dc4d2f04dc4d2f0
$ mkqdisk -L -d
+
</pre></pre>'''The cluster is still running with last node standing'''<br>Please note Total votes=quorum votes=5=2+3, if quorum disk vote is less than&nbsp; (node votes+1), the cluster&nbsp; wouldn’t have&nbsp; survived<br><pre style="background-color: rgb(251, 251, 251); border-bottom-color: rgb(206, 206, 206); border-bottom-width: 1px; border-bottom-style: solid; border-left-color: rgb(206, 206, 206); border-left-width: 1px; border-left-style: solid; border-right-color: rgb(206, 206, 206); border-right-width: 1px; border-right-style: solid; border-top-color: rgb(206, 206, 206); border-top-width: 1px; border-top-style: solid; min-height: 40px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 650px; "><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">$cman_tool status
mkqdisk v0.6.0
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">..
/dev/disk/by-id/scsi-1IET_00010002:
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Nodes: 1
/dev/disk/by-uuid/55fbf858-df75-493b-a764-5640be5a9b46:
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Expected votes: 9
/dev/sdc:
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Quorum device votes: 3
Magic:                eb7a62c2
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Total votes: 5
Label:                myqdisk
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">Quorum: 5   
Created:              Sat May  7 05:56:35 2011
+
</pre><pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">..</pre></pre></div><div style="margin-top: 0.75em; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; color: rgb(153, 153, 153); text-transform: uppercase; letter-spacing: 0.1em; font: normal normal normal 78%/normal 'Trebuchet MS', Trebuchet, Arial, Verdana, sans-serif; line-height: 1.4em; font-style: normal; font-variant: normal; font-weight: normal; orphans: 2; text-align: left; text-indent: 0px; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); " class="post-footer"><div class="post-footer-line post-footer-line-1"><span class="post-author vcard">POSTED BY<span class="Apple-converted-space">&nbsp;</span><span class="fn">HONGLUS</span><span class="Apple-converted-space">&nbsp;</span></span><span class="post-timestamp">AT<span class="Apple-converted-space">&nbsp;</span>[http://honglus.blogspot.com/2011/05/rhcsred-hat-cluster-suite-quorum-disk.html <abbr style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " title="2011-05-07T17:12:00+10:00" class="published">5:12 PM</abbr>]<span class="Apple-converted-space">&nbsp;</span></span><span class="reaction-buttons" /><span class="star-ratings" /><span class="post-comment-link" /><span class="post-backlinks post-comment-link" /><span class="post-icons"><span class="item-action">[http://www.blogger.com/email-post.g?blogID=1822605347830719087&postID=1979843398346145118 [[Image:]]<span class="Apple-converted-space">&nbsp;</span>]</span></span></div></div>
Host:                station2.example.com
+
Kernel Sector Size:  512
+
Recorded Sector Size: 512
+
Status block for node 1
+
Last updated by node 1
+
Last updated on Sat May  7 15:09:37 2011
+
State: Master
+
Flags: 0000
+
Score: 0/0
+
Average Cycle speed: 0.001500 seconds
+
Last Cycle speed: 0.000000 seconds
+
Incarnation: 4dc4d1764dc4d176
+
Status block for node 2
+
Last updated by node 2
+
Last updated on Sun May  8 01:09:38 2011
+
State: Running
+
Flags: 0000
+
Score: 0/0
+
Average Cycle speed: 0.001000 seconds
+
Last Cycle speed: 0.000000 seconds
+
Incarnation: 4dc55e164dc55e16
+
Status block for node 3
+
Last updated by node 3
+
Last updated on Sat May  7 15:09:38 2011
+
State: Running
+
Flags: 0000
+
Score: 0/0
+
Average Cycle speed: 0.001500 seconds
+
Last Cycle speed: 0.000000 seconds
+
Incarnation: 4dc4d2f04dc4d2f0
+
The cluster is still running with last node standing
+
Please note Total votes=quorum votes=5=2+3, if quorum disk vote is less than (node votes+1), the cluster wouldn’t have survived
+
$cman_tool status
+
..
+
Nodes: 1
+
Expected votes: 9
+
Quorum device votes: 3
+
Total votes: 5
+
Quorum: 5   
+
..
+
POSTED BY HONGLUS AT 5:12 PM
+

Edição das 01h54min de 24 de novembro de 2011

RHCS(Red Hat Cluster Suite) quorum disk

The last post "RHCS I/O fencing" is about dealing with split-brain situation, in which cluster members lost heartbeat communication and each believe it is legitimate to write data to the shared storage. 
Methods to deal with split-brain situation: 
1. Redundant heartbeat path 
network port communication plus serial port communication 
2. I/O fencing 
Remaining nodes separate failed node from its storage either by shutdown/reboot power port or storage port 
3. Quorum disk 
Quorum disk is a kind of I/O fencing, but the reboot action is executed by failed node's own quorum daemon. It also has additional feature: contributing vote to cluster. if you want the last standing node to keep the multiple-nodes cluster  running, quorum disk appears to be the only solution.
RHCS (Red Hat Cluster Suite) Quorum disk facts 
- A shared block device (SCSI/iSCSI/FC..), Device size requirement is approximately 10MiB 
- Supports maximum 16 nodes, nodes id must be sequentially ordered 
- Quorum disk can contribute  votes. In multiple nodes cluster, together with quorum vote, the last standing node can still keep the cluster running 
- single node votes+1 <=Quorum's disk vote < nodes total votes 
- The failure of the shared quorum disk won’t result in cluster failure, as long as Quorum's disk vote < nodes total votes 
- each node write its own health information in its own region, the health is determined by external checking program such as "ping"
Setup Quorum disk
#initialise quorum disk once in any node 
mkqdisk -c /dev/sdx -l myqdisk 
Add quorum disk to cluster 
Use luci or system-config-cluster to add quorum disk, following is the result xml file
<pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; "><clusternodes>
<clusternode name="<span style="color: rgb(139, 0, 0); ">station1.example.com</span>" nodeid="<span style="color: rgb(139, 0, 0); ">1</span>" votes="<span style="color: rgb(139, 0, 0); ">2</span>"> 
<fence/>
</clusternode>
<clusternode name="<span style="color: rgb(139, 0, 0); ">station2.example.com</span>" nodeid="<span style="color: rgb(139, 0, 0); ">2</span>" votes="<span style="color: rgb(139, 0, 0); ">2</span>"> 
<fence/>
</clusternode>
<clusternode name="<span style="color: rgb(139, 0, 0); ">station3.example.com</span>" nodeid="<span style="color: rgb(139, 0, 0); ">3</span>" votes="<span style="color: rgb(139, 0, 0); ">2</span>"> 
<fence/>
</clusternode>
</clusternodes>
<span style="color: green; ">#expected votes =9=(nodes total votes + quorum disk votes) = (2+2+2+3)       </span> 
<cman expected_votes="<span style="color: rgb(139, 0, 0); ">9</span>"/> 
<span style="color: green; ">#Health check result is writen to quorum disk every 2 secs</span> 
<span style="color: green; ">#if health check fails over 5 tko, 10 (2*5) secs, the node is rebooted by quorum daemon</span> 
<span style="color: green; ">#Each heuristic check is run very 2 secs and earn 1 score,if shell script return is 0</span> 
<quorumd interval="<span style="color: rgb(139, 0, 0); ">2</span>" label="<span style="color: rgb(139, 0, 0); ">myqdisk</span>" min_score="<span style="color: rgb(139, 0, 0); ">2</span>" tko="<span style="color: rgb(139, 0, 0); ">5</span>" votes="<span style="color: rgb(139, 0, 0); ">3</span>"> 
<heuristic interval="<span style="color: rgb(139, 0, 0); ">2</span>" program="<span style="color: rgb(139, 0, 0); ">ping -c1 -t1 192.168.1.60</span>" score="<span style="color: rgb(139, 0, 0); ">1</span>"/> 
<heuristic interval="<span style="color: rgb(139, 0, 0); ">2</span>" program="<span style="color: rgb(139, 0, 0); ">ping -c1 -t1 192.168.1.254</span>" score="<span style="color: rgb(139, 0, 0); ">1</span>"/> 
</quorumd>
</pre>Start quorum disk daemon
The daemon is also one of daemons automatically started by cman
service qdiskd start
Check quorum disk information
<pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">$ mkqdisk -L -d
mkqdisk v0.6.0
/dev/disk/by-id/scsi-1IET_00010002:
/dev/disk/by-uuid/55fbf858-df75-493b-a764-5640be5a9b46:
/dev/sdc:
Magic:                eb7a62c2
Label:                myqdisk
Created:              Sat May  7 05:56:35 2011
Host:                 station2.example.com
Kernel Sector Size:   512
Recorded Sector Size: 512
Status block <span style="color: blue; ">for</span> node 1 
Last updated by node 1
Last updated on Sat May  7 15:09:37 2011
State: Master
Flags: 0000
Score: 0/0
Average Cycle speed: 0.001500 seconds
Last Cycle speed: 0.000000 seconds
Incarnation: 4dc4d1764dc4d176
Status block <span style="color: blue; ">for</span> node 2 
Last updated by node 2
Last updated on Sun May  8 01:09:38 2011
State: Running
Flags: 0000
Score: 0/0
Average Cycle speed: 0.001000 seconds
Last Cycle speed: 0.000000 seconds
Incarnation: 4dc55e164dc55e16
Status block <span style="color: blue; ">for</span> node 3 
Last updated by node 3
Last updated on Sat May  7 15:09:38 2011
State: Running
Flags: 0000
Score: 0/0
Average Cycle speed: 0.001500 seconds
Last Cycle speed: 0.000000 seconds
Incarnation: 4dc4d2f04dc4d2f0
</pre>The cluster is still running with last node standing
Please note Total votes=quorum votes=5=2+3, if quorum disk vote is less than  (node votes+1), the cluster  wouldn’t have  survived
<pre style="background-color: rgb(251, 251, 251); font-family: consolas, 'Courier New', courier, monospace; font-size: 12px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 650px; ">$cman_tool status
..
Nodes: 1
Expected votes: 9
Quorum device votes: 3
Total votes: 5
Quorum: 5  
..
</pre>