1.3.3. Fencing

Fencing is the disconnection of a node from the cluster's shared storage. Fencing cuts off I/O from shared storage, thus ensuring data integrity. The cluster infrastructure performs fencing through the fence daemon, fenced.
当​​​​​​​ CMAN 决​​​​​​​定​​​​​​​某​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​已​​​​​​​经​​​​​​​发​​​​​​​生​​​​​​​故​​​​​​​障​​​​​​​,它​​​​​​​将​​​​​​​告​​​​​​​知​​​​​​​其​​​​​​​他​​​​​​​群​​​​​​​集​​​​​​​基​​​​​​​础​​​​​​​结​​​​​​​构​​​​​​​组​​​​​​​件​​​​​​​。​​​​​​​在​​​​​​​收​​​​​​​到​​​​​​​通​​​​​​​知​​​​​​​后​​​​​​​,fenced 将​​​​​​​保​​​​​​​护​​​​​​​(fence)故​​​​​​​障​​​​​​​节​​​​​​​点​​​​​​​。​​​​​​​其​​​​​​​他​​​​​​​群​​​​​​​集​​​​​​​基​​​​​​​础​​​​​​​结​​​​​​​构​​​​​​​组​​​​​​​件​​​​​​​将​​​​​​​决​​​​​​​定​​​​​​​采​​​​​​​取​​​​​​​什​​​​​​​么​​​​​​​行​​​​​​​动​​​​​​​ — 也​​​​​​​就​​​​​​​是​​​​​​​说​​​​​​​,它​​​​​​​们​​​​​​​执​​​​​​​行​​​​​​​任​​​​​​​何​​​​​​​必​​​​​​​需​​​​​​​的​​​​​​​恢​​​​​​​复​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​,当​​​​​​​ DLM 和​​​​​​​ GFS 被​​​​​​​告​​​​​​​知​​​​​​​节​​​​​​​点​​​​​​​故​​​​​​​障​​​​​​​时​​​​​​​,将​​​​​​​暂​​​​​​​停​​​​​​​活​​​​​​​动​​​​​​​,直​​​​​​​到​​​​​​​它​​​​​​​们​​​​​​​检​​​​​​​测​​​​​​​到​​​​​​​ fenced 已​​​​​​​经​​​​​​​完​​​​​​​成​​​​​​​对​​​​​​​故​​​​​​​障​​​​​​​节​​​​​​​点​​​​​​​的​​​​​​​保​​​​​​​护​​​​​​​。​​​​​​​当​​​​​​​确​​​​​​​认​​​​​​​故​​​​​​​障​​​​​​​节​​​​​​​点​​​​​​​已​​​​​​​经​​​​​​​被​​​​​​​保​​​​​​​护​​​​​​​时​​​​​​​,DLM 和​​​​​​​ GFS 会​​​​​​​执​​​​​​​行​​​​​​​恢​​​​​​​复​​​​​​​。​​​​​​​DLM 释​​​​​​​放​​​​​​​对​​​​​​​失​​​​​​​败​​​​​​​节​​​​​​​点​​​​​​​的​​​​​​​锁​​​​​​​定​​​​​​​;GFS 恢​​​​​​​复​​​​​​​故​​​​​​​障​​​​​​​节​​​​​​​点​​​​​​​的​​​​​​​日​​​​​​​志​​​​​​​。​​​​​​​
保​​​​​​​护​​​​​​​程​​​​​​​序​​​​​​​根​​​​​​​据​​​​​​​群​​​​​​​集​​​​​​​配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​决​​​​​​​定​​​​​​​使​​​​​​​用​​​​​​​哪​​​​​​​种​​​​​​​保​​​​​​​护​​​​​​​方​​​​​​​法​​​​​​​。​​​​​​​群​​​​​​​集​​​​​​​配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​用​​​​​​​两​​​​​​​个​​​​​​​关​​​​​​​键​​​​​​​元​​​​​​​素​​​​​​​定​​​​​​​义​​​​​​​了​​​​​​​保​​​​​​​护​​​​​​​方​​​​​​​法​​​​​​​:保​​​​​​​护​​​​​​​代​​​​​​​理​​​​​​​(fencing agent)和​​​​​​​保​​​​​​​护​​​​​​​设​​​​​​​备​​​​​​​(fencing device)。​​​​​​​保​​​​​​​护​​​​​​​程​​​​​​​序​​​​​​​调​​​​​​​用​​​​​​​这​​​​​​​里​​​​​​​定​​​​​​​义​​​​​​​的​​​​​​​保​​​​​​​护​​​​​​​代​​​​​​​理​​​​​​​。​​​​​​​而​​​​​​​保​​​​​​​护​​​​​​​代​​​​​​​理​​​​​​​则​​​​​​​通​​​​​​​过​​​​​​​保​​​​​​​护​​​​​​​设​​​​​​​备​​​​​​​来​​​​​​​保​​​​​​​护​​​​​​​节​​​​​​​点​​​​​​​。​​​​​​​当​​​​​​​保​​​​​​​护​​​​​​​过​​​​​​​程​​​​​​​结​​​​​​​束​​​​​​​时​​​​​​​,保​​​​​​​护​​​​​​​程​​​​​​​序​​​​​​​将​​​​​​​通​​​​​​​知​​​​​​​群​​​​​​​集​​​​​​​管​​​​​​​理​​​​​​​器​​​​​​​。​​​​​​​
Red Hat Cluster Suite提​​​​​​​供​​​​​​​各​​​​​​​种​​​​​​​保​​​​​​​护​​​​​​​方​​​​​​​法​​​​​​​:
  • 电​​​​​​​源​​​​​​​保​​​​​​​护​​​​​​​(Power fencing)— 该​​​​​​​方​​​​​​​法​​​​​​​使​​​​​​​用​​​​​​​电​​​​​​​源​​​​​​​控​​​​​​​制​​​​​​​器​​​​​​​来​​​​​​​关​​​​​​​闭​​​​​​​不​​​​​​​可​​​​​​​操​​​​​​​作​​​​​​​的​​​​​​​节​​​​​​​点​​​​​​​。​​​​​​​
  • 光​​​​​​​线​​​​​​​通​​​​​​​道​​​​​​​开​​​​​​​关​​​​​​​保​​​​​​​护​​​​​​​(Fibre Channel switch fencing)— 该​​​​​​​方​​​​​​​法​​​​​​​禁​​​​​​​用​​​​​​​连​​​​​​​接​​​​​​​至​​​​​​​不​​​​​​​可​​​​​​​操​​​​​​​作​​​​​​​节​​​​​​​点​​​​​​​的​​​​​​​光​​​​​​​线​​​​​​​通​​​​​​​道​​​​​​​端​​​​​​​口​​​​​​​。​​​​​​​
  • GNBD fencing — A fencing method that disables an inoperable node's access to a GNBD server.
  • 其​​​​​​​他​​​​​​​保​​​​​​​护​​​​​​​方​​​​​​​法​​​​​​​ — 如​​​​​​​禁​​​​​​​用​​​​​​​ I/O 或​​​​​​​不​​​​​​​可​​​​​​​操​​​​​​​作​​​​​​​节​​​​​​​点​​​​​​​的​​​​​​​电​​​​​​​源​​​​​​​,包​​​​​​​括​​​​​​​ IBM Bladecenters, PAP, DRAC/MC, HP ILO, IPMI, IBM RSA II 等​​​​​​​。​​​​​​​
图 1.3 “Power Fencing Example” shows an example of power fencing. In the example, the fencing program in node A causes the power controller to power off node D. 图 1.4 “Fibre Channel Switch Fencing Example” shows an example of Fibre Channel switch fencing. In the example, the fencing program in node A causes the Fibre Channel switch to disable the port for node D, disconnecting node D from storage.
Power Fencing Example

图 1.3. Power Fencing Example

Fibre Channel Switch Fencing Example

图 1.4. Fibre Channel Switch Fencing Example

指​​​​​​​定​​​​​​​保​​​​​​​护​​​​​​​方​​​​​​​法​​​​​​​通​​​​​​​过​​​​​​​编​​​​​​​辑​​​​​​​群​​​​​​​集​​​​​​​配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​完​​​​​​​成​​​​​​​,如​​​​​​​分​​​​​​​配​​​​​​​保​​​​​​​护​​​​​​​方​​​​​​​法​​​​​​​名​​​​​​​、​​​​​​​保​​​​​​​护​​​​​​​代​​​​​​​理​​​​​​​(fencing agent)、​​​​​​​以​​​​​​​及​​​​​​​用​​​​​​​于​​​​​​​群​​​​​​​集​​​​​​​里​​​​​​​每​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​的​​​​​​​保​​​​​​​护​​​​​​​设​​​​​​​备​​​​​​​(fencing device)。​​​​​​​
The way in which a fencing method is specified depends on if a node has either dual power supplies or multiple paths to storage. If a node has dual power supplies, then the fencing method for the node must specify at least two fencing devices — one fencing device for each power supply (refer to 图 1.5 “Fencing a Node with Dual Power Supplies”). Similarly, if a node has multiple paths to Fibre Channel storage, then the fencing method for the node must specify one fencing device for each path to Fibre Channel storage. For example, if a node has two paths to Fibre Channel storage, the fencing method should specify two fencing devices — one for each path to Fibre Channel storage (refer to 图 1.6 “Fencing a Node with Dual Fibre Channel Connections”).
Fencing a Node with Dual Power Supplies

图 1.5. Fencing a Node with Dual Power Supplies

Fencing a Node with Dual Fibre Channel Connections

图 1.6. Fencing a Node with Dual Fibre Channel Connections

您​​​​​​​可​​​​​​​以​​​​​​​配​​​​​​​置​​​​​​​节​​​​​​​点​​​​​​​具​​​​​​​有​​​​​​​一​​​​​​​个​​​​​​​或​​​​​​​多​​​​​​​个​​​​​​​保​​​​​​​护​​​​​​​方​​​​​​​法​​​​​​​。​​​​​​​当​​​​​​​您​​​​​​​配​​​​​​​置​​​​​​​某​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​具​​​​​​​有​​​​​​​一​​​​​​​个​​​​​​​保​​​​​​​护​​​​​​​方​​​​​​​法​​​​​​​时​​​​​​​,这​​​​​​​个​​​​​​​方​​​​​​​法​​​​​​​就​​​​​​​是​​​​​​​保​​​​​​​护​​​​​​​该​​​​​​​节​​​​​​​点​​​​​​​的​​​​​​​唯​​​​​​​一​​​​​​​可​​​​​​​用​​​​​​​保​​​​​​​护​​​​​​​方​​​​​​​法​​​​​​​。​​​​​​​而​​​​​​​当​​​​​​​您​​​​​​​配​​​​​​​置​​​​​​​某​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​具​​​​​​​有​​​​​​​多​​​​​​​个​​​​​​​保​​​​​​​护​​​​​​​方​​​​​​​法​​​​​​​时​​​​​​​,保​​​​​​​护​​​​​​​方​​​​​​​法​​​​​​​将​​​​​​​按​​​​​​​照​​​​​​​群​​​​​​​集​​​​​​​配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​里​​​​​​​指​​​​​​​定​​​​​​​的​​​​​​​顺​​​​​​​序​​​​​​​挨​​​​​​​个​​​​​​​进​​​​​​​行​​​​​​​层​​​​​​​叠​​​​​​​(cascade)。​​​​​​​如​​​​​​​果​​​​​​​某​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​出​​​​​​​现​​​​​​​故​​​​​​​障​​​​​​​,配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​里​​​​​​​指​​​​​​​定​​​​​​​的​​​​​​​第​​​​​​​一​​​​​​​个​​​​​​​保​​​​​​​护​​​​​​​方​​​​​​​法​​​​​​​将​​​​​​​对​​​​​​​它​​​​​​​进​​​​​​​行​​​​​​​保​​​​​​​护​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​第​​​​​​​一​​​​​​​个​​​​​​​保​​​​​​​护​​​​​​​方​​​​​​​法​​​​​​​没​​​​​​​有​​​​​​​成​​​​​​​功​​​​​​​,指​​​​​​​定​​​​​​​的​​​​​​​第​​​​​​​二​​​​​​​个​​​​​​​保​​​​​​​护​​​​​​​方​​​​​​​法​​​​​​​将​​​​​​​被​​​​​​​使​​​​​​​用​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​所​​​​​​​有​​​​​​​方​​​​​​​法​​​​​​​都​​​​​​​没​​​​​​​有​​​​​​​成​​​​​​​功​​​​​​​,保​​​​​​​护​​​​​​​将​​​​​​​从​​​​​​​第​​​​​​​一​​​​​​​个​​​​​​​保​​​​​​​护​​​​​​​方​​​​​​​法​​​​​​​重​​​​​​​新​​​​​​​开​​​​​​​始​​​​​​​,且​​​​​​​安​​​​​​​装​​​​​​​群​​​​​​​集​​​​​​​配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​里​​​​​​​指​​​​​​​定​​​​​​​的​​​​​​​顺​​​​​​​序​​​​​​​进​​​​​​​行​​​​​​​循​​​​​​​环​​​​​​​,直​​​​​​​到​​​​​​​这​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​被​​​​​​​成​​​​​​​功​​​​​​​地​​​​​​​保​​​​​​​护​​​​​​​为​​​​​​​止​​​​​​​。​​​​​​​