[Linux-cluster] Few queries about fence working

jayesh.shinde jayesh.shinde at netcore.co.in
Wed Jan 25 13:57:28 UTC 2012


Hi Kaloyan Kovachev ,

I am using below config  in drbd.conf  which is mention on DRBD cookbook.

}
   disk {
     fencing resource-and-stonith;
   }
   handlers {
     outdate-peer "/sbin/obliterate";

Under  /sbin/obliterate script , "fence_node" is mention.

*Do you know what is the default method with "**fence_node $REMOTE" *i.e 
reboot of power-off ?

Dear Digimer ,

Can you please guide me here.

Currently I am not having the test machine to test it , so all member's  
inputs will help me a lot to understand it.

Below is the /sbin/obliterate


#!/bin/bash
# ###########################################################
# DRBD 0.8.2.1 -> linux-cluster super-simple fencing wrapper
#
# Copyright Red Hat, 2007
#
# Licensed under the GNU General Public License version 2
# which is incorporated herein by reference:
#
#   http://www.gnu.org/licenses/gpl-2.0.html
#
# At your option, you may choose to license this software
# under any later version of the GNU General Public License.
#
# This software is distributed in the hopes that it will be
# useful, but without warranty of any kind.
#
# Kills the other node in a 2-node cluster.  Only works with
# 2-node clusters (FIXME?)
#
# ###########################################################
#
# Author: Lon Hohberger <lhh[a]redhat.com>
#
# Special thanks to fabioc on freenode
#

PATH="/bin:/sbin:/usr/bin:/usr/sbin"

NODECOUNT=0
LOCAL_ID=$(cman_tool status 2>/dev/null | grep '^Node ID:' | awk '{print 
$3}')
REMOTE_ID=""
REMOTE=""

if [ -z "$LOCAL_ID" ]; then
         echo "Could not determine local node ID!"
         exit 1
fi

# Shoot the other guy.
while read nid nodename; do
         if [ "$nid" = "0" ]; then
                 continue
         fi

         ((NODECOUNT++))

         if [ "$nid" != "$LOCAL_ID" ]; then
                 REMOTE_ID=$nid
                 REMOTE=$nodename
         fi
done < <(cman_tool nodes 2>/dev/null | grep -v '^Node' | awk '{print 
$1,$6}')

if [ $NODECOUNT -ne 2 ]; then
         echo "Only works with 2 node clusters"
         exit 1
fi

if [ -z "$REMOTE_ID" ] || [ -z "$REMOTE" ]; then
         echo "Could not determine remote node"
         exit 1
fi

echo "Local node ID: $LOCAL_ID"
echo "Remote node ID: $REMOTE_ID"
echo "Remote node: $REMOTE "

#
# This could be cleaner by calling cman_tool kill -n <node>, but then we 
have
# to poll/wait for fence status, and I don't feel like writing that right
# now.  Note that GFS *will* wait for this to occur, so if you're using GFS
# on DRBD, you still don't get access. ;)
#
fence_node $REMOTE

if [ $? -eq 0 ]; then
         #
         # Reference:
         # http://osdir.com/ml/linux.kernel.drbd.devel/2006-11/msg00005.html
         #
         # 7 = node got blown away.
         #
         exit 7
fi

#
# Fencing failed?!
#
exit 1

Regards
Jayesh Shinde




On 01/25/2012 04:02 PM, Kaloyan Kovachev wrote:
>> <resources>
>> <ip address="192.168.1.1" monitor_link="1"/>
>> <fs device="/dev/drbd0" force_fsck="0" force_unmount="1" fsid="28418"
>> fstype="ext3" mountpoint="/mount/path" name="imap1_fs" options="rw"
>> self_fence="1"/>
> You have self_fence, which should reboot the node instead of power off,
> but as you are using drbd - the power off may be caused from drbd instead
> (check drbd.conf)
>
>> <script file="/etc/init.d/cyrus-imapd" name="imap1_init"/>
>> </resources>
> In either case if the remote node is not fenced it is safer to shutdown
> instead of having the service run at both, so i wouldn't change anything
>
> --
> Linux-cluster mailing list
> Linux-cluster at redhat.com
> https://www.redhat.com/mailman/listinfo/linux-cluster

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/linux-cluster/attachments/20120125/46816d2a/attachment.htm>


More information about the Linux-cluster mailing list