Add monitoring of quorum and make the node UNHEALTHY when quarum is lost
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 24 May 2010 02:33:47 +0000 (12:33 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 25 May 2010 02:46:28 +0000 (12:46 +1000)
config/events.d/62.cnfs

index 4003ea44fe4190aeb14bf65ab9ccbbfc9908037c..25776758fc2a0a30dcdf193b34bb782225d9ea61 100755 (executable)
@@ -23,6 +23,12 @@ check_if_healthy() {
                 exit 0
         }
 
+        [ -f "$STATEDIR/gpfsnoquorum" ] && {
+                logger No GPFS quorum. Node is UNHEALTHY
+                $CTDB_BASE/events.d/62.cnfs unhealthy "No GPFS quorum. Nodfe is UNHEALTHY."
+               exit 0
+       }
+
         logger All required GPFS resources are available. CNFS part is healthy.
         $CTDB_BASE/events.d/62.cnfs healthy
 }
@@ -82,11 +88,31 @@ case "$1" in
     # It checks that all required NFS filesystems are mounted 
     # and flags the node healthy if so.
     gpfsstartup)
+       # assume we always have quorum when starting
+       # we are only interested in the case when we explicitely
+       # lost quorum in an otherwise happy cluster
+        mkdir -p $STATEDIR
+        rm -f "$STATEDIR/gpfsnoquorum"
         logger "GPFS is is started."
         check_if_healthy
         ;;
 
 
+    gpfsquorumreached)
+        mkdir -p $STATEDIR
+        rm -f "$STATEDIR/gpfsnoquorum"
+        logger "GPFS quorum has been reached."
+        check_if_healthy
+        ;;
+
+    gpfsquorumloss)
+        mkdir -p $STATEDIR
+        touch "$STATEDIR/gpfsnoquorum"
+        logger "GPFS quorum has been lost."
+        $CTDB_BASE/events.d/62.cnfs unhealthy "GPFS quorum was lost! Marking node as UNHEALTHY."
+        ;;
+
+