Criar QuorumDisk

De Slacam_Wiki
Ir para: navegação, pesquisa

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>