Dominik Klein wrote:
Mujtaba, Sayed Mohammed wrote:
Hi,
  I am able to fence it using external/ssh for my testing but need some
clarification as I modified some part here... I observed from log file that heartbeat GUI invokes this script for fencing of other node (Stonith external ssh)
/usr/lib64/stonith/plugins/external/ssh off p6pv2

You can configure a cluster option called "stonith-action" and I guess
yours is set to poweroff (or powerdown? can't remember). If you set it
to "reboot" (which is the default), nodes would be rebooted instead of
shutdown.
It is poweroff
But when I checked the script I found below code which is not doing any
thing (for case on and off)

case $1 in
gethosts)
        for h in $hostlist ; do
                echo $h
        done
        exit 0
        ;;
on)
        # Can't really be implemented because ssh cannot power on a
system
        # when it is powered off.
        exit 1
        ;;

Does this comment not make it clear enough? How would you "power on" a
node through ssh? Impossible.

off)
        # Shouldn't really be implemented because if ssh cannot power on
a
        # system, it shouldn't be allowed to power it off.

        rsh p6pv2 reboot
        exit 1
        ;;
reset)
        for h in $hostlist

off)
        # Shouldn't really be implemented because if ssh cannot power on
a
        # system, it shouldn't be allowed to power it off.
        exit 1

See above. If you power it off with the ssh "device", it will never be
able to start it again. So this is unimplemented. Makes sense to me.

        ;;
 For testing I enabled remote ssh on node which is to be fenced and put
this code below in  case off

     off)
        # Shouldn't really be implemented because if ssh cannot power on
a
        # system, it shouldn't be allowed to power it off.

        rsh p6pv2 reboot
        exit 1
        ;;


  And I observed that it is able to reboot(fence) the other node
successfully and testing is working as expected  ...

This will likely cause problems. Stonithd thinks it could not power off
the node (exit 1) but in fact, it restarted it.

Correct
  Anyone having idea why this part of code is not doing any thing ?
As Dominik mentioned in an earlier note, ssh and external/ssh are only meant for testing purposes and should not be used in a production environment. Neither of these STONITH devices are reliable when
there are communication issues between nodes.

You cannot ssh into a machine that is powered off, so "ssh on" is impossible. Likewise, "ssh off" is not implemented because "ssh on" cannot work. To keep the cluster up and running and manageable,
"ssh reset" is the only one that makes sense.

If you set stonith-action to poweroff, then every time heartbeat fences a node, you will have to physically power it on yourself to get it back into the cluster. This is not usually what folks want,
hence the default for stonith-action is reboot.

Do you have atd running on both machines? If you look at the definition of REBOOT_COMMAND
and POWEROFF_COMMAND you will see it is required.
means is it some bug I found or any strong reason behind not fencing in
that part ...
   If it is bug can my corrected code can be taken as for bug fixing??

Rather not I think.

Regards
Dominik
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems


_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to