[ClusterLabs] Antw: Re: Trying to understand the default action of a fence agent

Ulrich Windl Ulrich.Windl at rz.uni-regensburg.de
Wed Jan 9 07:22:24 UTC 2019


>>> Ken Gaillot <kgaillot at redhat.com> schrieb am 08.01.2019 um 17:55 in
Nachricht
<a05ebc149d9e4c636d8616eb4697d2d63dd1024b.camel at redhat.com>:
> On Tue, 2019‑01‑08 at 07:35 ‑0600, Bryan K. Walton wrote:
>> Hi,
>> 
>> I'm building a two node cluster with Centos 7.6 and DRBD.  These
>> nodes
>> are connected upstream to two Brocade switches.  I'm trying to enable
>> fencing by using Digimer's fence_dlink_snmp script (
>> https://github.com/digimer/fence_dlink_snmp ).
>> 
>> I've renamed the script to fence_brocade_snmp and have 
>> created my stonith resources using the following syntax:
>> 
>> pcs ‑f stonith_cfg stonith create fenceStorage1‑centipede \
>> fence_brocade_snmp pcmk_host_list=storage1‑drbd ipaddr=10.40.1.1 \
>> community=xxxxxxx port=193 pcmk_off_action="off" \
>> pcmk_monitor_timeout=120s 
> 
> FYI pcmk_off_action="off" is the default
> 
> If you want the cluster to request an "off" command instead of a
> "reboot" when fencing a node, set the stonith‑action cluster property
> to "off".
> 
>> When I run "stonith‑admin storage1‑drbd", from my other node, 
>> the switch ports do not get disabled.  However, when I run
>> "stonith_admin ‑F storage1‑drbd", the switch ports DO get disabled.
> 
> The pacemaker CLI commands don't always say anything when invalid
> option combinations are used (fixing that is one of the many things on
> the "would‑be‑nice" list). Your first command does nothing (and the

IMHO it should be on the "reqired" list ;-)
I my C programs I usually create an error message, set some flag, and continue
parsing the rest of the options (just to flag as many errors as possible, not
just the first one), then I quit if errors were found. Then I'll check the
parameters set so far for errors, If so, I'll quit. The remaining erros are not
syntax errors, then...

...option processing
                                        bad_arg(option, optarg);
                                        result = 1;
...more options
        if ( result != 0 )
        {
                if ( result == 1 )
                        usage();
                goto quit;
        }
...check parameters and initialize
        if ( result != 0 )
                goto quit;
...now start doing something useful
...

Regards,
Ulrich

> forthcoming 2.0.1 version will give a usage error). The second command
> is the correct command to fence a node (‑F for "off" or ‑B for
> "reboot").
> 
>> If I run "pcs stonith fence storage1‑drbd", from the other node, the
>> response is: "Node: storage1‑drbd fenced", but, again, the switch
>> ports
>> are still enabled.  I'm forced to instead run: "pcs stonith fence
>> storage1‑drbd ‑‑off" to get the ports to be disabled.
> 
> I believe "pcs stonith fence" by default sends a reboot command, so it
> sounds like your fence agent doesn't implement reboot (or implements it
> incorrectly, or perhaps a reboot is equivalent to disabling the ports
> then re‑enabling them and so is not useful). I'd use stonith‑action=off 
> as mentioned above.
> 
>> What I'm trying to figure out, is under what scenario should I see
>> the
>> ports actually get disabled?  My concern is that, for example, I can
>> stop the cluster on storage1‑drbd, and the logs will show that the
>> fencing was successful, and then my resources get moved.  But when I
>> check on the switch ports that are connected to storage1‑drbd, they
>> are
>> still enabled.  So, the node does not appear to be really fenced. 
>> 
>> Do I need to create my stonith resource differently to actually
>> disable
>> those ports?
>> 
>> Thank you for your time.  I am greatly appreciative.
>> 
>> Sincerely,
>> Bryan Walton
>> 
>> 
>> ‑‑ 
>> Bryan K. Walton                                           319‑337‑
>> 3877 
>> Linux Systems Administrator                 Leepfrog Technologies,
>> Inc 
>> 
>> ‑‑‑‑‑ End forwarded message ‑‑‑‑‑
>> 
> 
> _______________________________________________
> Users mailing list: Users at clusterlabs.org 
> https://lists.clusterlabs.org/mailman/listinfo/users 
> 
> Project Home: http://www.clusterlabs.org 
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf 
> Bugs: http://bugs.clusterlabs.org 





More information about the Users mailing list