This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: RHEL52 - init.d/cman: use fence_tool -m for two node clusters


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=7da342092f2df950d82e0fd7a7372757b821a27c
Commit:        7da342092f2df950d82e0fd7a7372757b821a27c
Parent:        e4aecceba36426b1a148a49c83d4f32eac351275
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Tue Aug 26 16:28:20 2008 -0500
Committer:     Chris Feist <cfeist@redhat.com>
CommitterDate: Wed Dec 3 16:17:27 2008 -0600

init.d/cman: use fence_tool -m for two node clusters

bz 460190

Use the new fence_tool -m option in the cman init script for two node
clusters.  This delays fence_tool join when both nodes aren't members.
The delay allows initial cluster partitions (due to badly configured
network/switches) to converge before starting fencing.

Signed-off-by: David Teigland <teigland@redhat.com>
---
 cman/init.d/cman |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/cman/init.d/cman b/cman/init.d/cman
index be26226..c2f6ae0 100755
--- a/cman/init.d/cman
+++ b/cman/init.d/cman
@@ -39,6 +39,10 @@
 #     wait indefinately for fenced to start.
 [ -z "$FENCED_START_TIMEOUT" ] && FENCED_START_TIMEOUT=300
 
+# FENCED_MEMBER_DELAY -- amount of time to delay fence_tool join to allow
+#     all nodes in cluster.conf to become cluster members.  In seconds.
+[ -z "$FENCED_MEMBER_DELAY" ] && FENCED_MEMBER_DELAY=45
+
 [ -z "$LOCK_FILE" ] && LOCK_FILE="/var/lock/subsys/cman"
 
 [ -n "$CLUSTERNAME" ] && cman_join_opts="-c $CLUSTERNAME"
@@ -120,8 +124,16 @@ start_daemons()
 
 start_fence()
 {
-    errmsg=$( /sbin/fence_tool -w -t $FENCED_START_TIMEOUT join \
-	     > /dev/null 2>&1 ) || return 1
+    /usr/sbin/cman_tool status | grep Flags | grep 2node &> /dev/null
+    if [ $? -ne 0 ]
+    then
+        errmsg=$( /sbin/fence_tool -w -t $FENCED_START_TIMEOUT join \
+                 > /dev/null 2>&1 ) || return 1
+    else
+        errmsg=$( /sbin/fence_tool -w -t $FENCED_START_TIMEOUT \
+                 -m $FENCED_MEMBER_DELAY join \
+                 > /dev/null 2>&1 ) || return 1
+    fi
     return 0
 }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]