[Pacemaker] stonith q

Digimer lists at alteeve.ca
Sun Nov 2 11:25:43 EST 2014


On 02/11/14 06:45 AM, Andrei Borzenkov wrote:
> В Sun, 2 Nov 2014 10:01:59 +0000
> Alex Samad - Yieldbroker <Alex.Samad at yieldbroker.com> пишет:
>
>>
>>
>>> -----Original Message-----
>>> From: Digimer [mailto:lists at alteeve.ca]
>>> Sent: Sunday, 2 November 2014 9:49 AM
>>> To: The Pacemaker cluster resource manager
>>> Subject: Re: [Pacemaker] stonith q
>>>
>>> On 01/11/14 06:27 PM, Alex Samad - Yieldbroker wrote:
>>>> Hi
>>>>
>>>> 2 node cluster, running under vmware
>> {snip}
>>>>
>>>> Alex
>>>
>>> In cman's cluster.conf, you configure the fence device 'fence_pcmk', as you
>>> have. That is a dummy/hook fence agent that simply passes fence requests
>>> up to pacemaker to actually perform. Pacemaker will then tell cman whether
>>> the fence succeeded or failed.
>>>
>>> To make sure you have cluster.conf configured properly, it should look
>>> something like this;
>>>
>>> ====
>>> ccs -f /etc/cluster/cluster.conf --createcluster an-anvil-04 ccs -f
>>> /etc/cluster/cluster.conf --setcman two_node="1" expected_votes="1"
>>> ccs -f /etc/cluster/cluster.conf --addnode an-a04n01.alteeve.ca ccs -f
>>> /etc/cluster/cluster.conf --addnode an-a04n02.alteeve.ca ccs -f
>>> /etc/cluster/cluster.conf --addfencedev pcmk agent=fence_pcmk ccs -f
>>> /etc/cluster/cluster.conf --addmethod pcmk-redirect an-a04n01.alteeve.ca
>>> ccs -f /etc/cluster/cluster.conf --addmethod pcmk-redirect an-
>>> a04n02.alteeve.ca ccs -f /etc/cluster/cluster.conf --addfenceinst pcmk an-
>>> a04n01.alteeve.ca pcmk-redirect port=an-a04n01.alteeve.ca ccs -f
>>> /etc/cluster/cluster.conf --addfenceinst pcmk an-a04n02.alteeve.ca pcmk-
>>> redirect port=an-a04n02.alteeve.ca ccs -f /etc/cluster/cluster.conf --
>>> setfencedaemon post_join_delay="30"
>>> cat /etc/cluster/cluster.conf
>>> ====
>>> <cluster config_version="10" name="an-anvil-04">
>>>     <fence_daemon post_join_delay="30"/>
>>>     <clusternodes>
>>>       <clusternode name="an-a04n01.alteeve.ca" nodeid="1">
>>>         <fence>
>>>           <method name="pcmk-redirect">
>>>             <device name="pcmk" port="an-a04n01.alteeve.ca"/>
>>>           </method>
>>>         </fence>
>>>       </clusternode>
>>>       <clusternode name="an-a04n02.alteeve.ca" nodeid="2">
>>>         <fence>
>>>           <method name="pcmk-redirect">
>>>             <device name="pcmk" port="an-a04n02.alteeve.ca"/>
>>>           </method>
>>>         </fence>
>>>       </clusternode>
>>>     </clusternodes>
>>>     <cman expected_votes="1" two_node="1"/>
>>>     <fencedevices>
>>>       <fencedevice agent="fence_pcmk" name="pcmk"/>
>>>     </fencedevices>
>>>     <rm>
>>>       <failoverdomains/>
>>>       <resources/>
>>>     </rm>
>>> </cluster>
>>> ====
>>
>> [Alex Samad - Yieldbroker]
>> Actually I do, I just put the initial bit in there.
>>
>>>
>>> Then you move over to pacemaker and configure stonith there. How you do
>>> this will vary a bit for your fence agent. I use IPMI fencing, which looks like
>>> this:
>>>
>>> ====
>>> pcs cluster cib stonith_cfg
>>> pcs -f stonith_cfg stonith create fence_n01_ipmi fence_ipmilan
>>> pcmk_host_list="an-a04n01.alteeve.ca" ipaddr="an-a04n01.ipmi"
>>> action="reboot" login="admin" passwd="Initial1" delay=15 op monitor
>>> interval=10s pcs -f stonith_cfg stonith create fence_n02_ipmi fence_ipmilan
>>> pcmk_host_list="an-a04n02.alteeve.ca" ipaddr="an-a04n02.ipmi"
>>> action="reboot" login="admin" passwd="Initial1" op monitor interval=10s
>>> pcs cluster cib-push stonith_cfg pcs property set stonith-enabled=true ====
>> [Alex Samad - Yieldbroker]
>>
>> Problem is that uses ipmi I don't want to use that.
>>
>> I would like to translater a stonight shutdown/reboot into a OS reboot commend.
>>
>
> That hardly makes sense except in pure test environment. Stonith is
> needed when you do not know state of partner node, in which case you
> cannot be sure your reboot/shutdown command will be executed, nor that
> you can reach your partner at all.
>
> If you are running under Vmware, use stonith/vmware or stonith/vcenter.

Andrei is correct. A stonith method must be external to the node and 
work regardless of the state of a node. Try this; 'echo c > 
/proc/sysrq-trigger' will crash the node. Any stonith method that 
requires the OS to respond will fail and your cluster will hang.

-- 
Digimer
Papers and Projects: https://alteeve.ca/w/
What if the cure for cancer is trapped in the mind of a person without 
access to education?




More information about the Pacemaker mailing list