[Ocfs2-tools-commits] jlbec commits r522 - in trunk: . vendor/common

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Dec 30 13:35:19 CST 2004


Author: jlbec
Date: 2004-12-30 13:35:17 -0600 (Thu, 30 Dec 2004)
New Revision: 522

Added:
   trunk/README.O2CB
Modified:
   trunk/vendor/common/o2cb.init
Log:

o Use O2CB_ENABLED value during startup.
o Add README.O2CB to help folks get started.



Added: trunk/README.O2CB
===================================================================
--- trunk/README.O2CB	2004-12-30 00:17:56 UTC (rev 521)
+++ trunk/README.O2CB	2004-12-30 19:35:17 UTC (rev 522)
@@ -0,0 +1,111 @@
+
+O2CB is a simple set of clustering services required to get OCFS2 going.
+A more complete cluster infrastructure may replace it later.
+
+[Describing Your Cluster Configuration]
+
+In the future, ocfs2-tool and o2cb_ctl will allow you to manage the
+cluster configuration in a much nicer way.  But until then, you have to
+hand-edit the file.
+
+The cluster confguration is stored in /etc/cluster.conf.  This is a
+hardcoded name right now (boo!), so you have to put it there.  The file
+is in stanza format, with one stanza describing the generic cluster
+attributes and one stanza for each node.
+
+The stanza for the generic cluster attributes looks like so:
+
+cluster:
+	name = mycluster
+	node_count = 2
+
+Both attributes are required.  The cluster name must start with a letter
+and be made of the usual [-a-ZA-Z0-9_] characters.  The node_count
+attribute must match the number of node stanzas.
+
+Each node is described by a stanza:
+
+node:
+	name = ca-test17
+	cluster = mycluster
+	number = 0
+	ip_address = 139.185.118.117
+	ip_port = 7777
+
+Each attribute is required.  The name has the same character
+restrictions that the cluster name does.  The cluster attribute _must_
+match the name of the cluster, or this node stanza will be ignored.
+
+[Starting the OCFS2 Clustering Services]
+
+O2CB is comprised of a simple node manager, heartbeat, TCP protocol, and
+DLM.  The basic steps in startup are as follows:
+
+1) Load the nodemanager, heartbeat, and tcp modules
+2) Mount the nodemanager and heartbeat pseudo filesystems.
+3) Load the cluster information via o2cb_ctl.  This adds all the
+   known nodes to the nodemanager's psuedo filesystem.
+4) Load the DLM module.
+5) Load the OCFS2 module.
+6) Mount an OCFS2 filesystem.
+
+The /etc/init.d/o2cb program is responsible for handling steps 1-3
+during the boot of a machine.
+
+To enable steps 1 and 2 on boot:
+
+    # /etc/init.d/o2cb enable
+    Writing O2CB configuration: OK
+
+or:
+
+    # /etc/init.d/o2cb configure
+    Configuring the O2CB driver.
+    
+    This will configure the on-boot properties of the O2CB driver.
+    The following questions will determine whether the driver is loaded on
+    boot.  The current values will be shown in brackets ('[]').  Hitting
+    <ENTER> without typing an answer will keep that current value.  Ctrl-C
+    will abort.
+    
+    Load O2CB driver on boot (y/n) [n]: y
+    Cluster to start on boot (Enter "none" to clear) []:
+    Writing O2CB configuration: OK
+
+If you want step 3 to occur on boot, you must name the cluster to start:
+
+    # /etc/init.d/o2cb configure
+    Configuring the O2CB driver.
+
+    This will configure the on-boot properties of the O2CB driver.
+    The following questions will determine whether the driver is loaded on
+    boot.  The current values will be shown in brackets ('[]').  Hitting
+    <ENTER> without typing an answer will keep that current value.  Ctrl-C
+    will abort.
+
+    Load O2CB driver on boot (y/n) [n]: y
+    Cluster to start on boot (Enter "none" to clear) []: mycluster
+    Writing O2CB configuration: OK
+
+You can now start the cluster by hand as well, with:
+
+    # /etc/init.d/o2cb start
+
+If you don't want to configure O2CB to start on boot, or if you don't
+want to configure a specific cluster to start by default, you can run
+the steps manually.
+
+To run steps 1 and 2:
+
+    # /etc/init.d/o2cb load
+
+To start a cluster (step 3):
+
+    # /etc/init.d/o2cb online mycluster
+
+To stop a cluster and unload the modules, you simply use:
+
+    # /etc/init.d/o2cb stop
+
+Unloading the modules doesn't work right now.
+

Modified: trunk/vendor/common/o2cb.init
===================================================================
--- trunk/vendor/common/o2cb.init	2004-12-30 00:17:56 UTC (rev 521)
+++ trunk/vendor/common/o2cb.init	2004-12-30 19:35:17 UTC (rev 522)
@@ -224,7 +224,7 @@
     fi
     MODNAME="$1"
 
-    MODOUT="`awk '$1 ~ /^'$MODNAME'$/{print $1;exit}' < /proc/modules 2>/dev/null`"
+    MODOUT="$(awk '$1 ~ /^'$MODNAME'$/{print $1;exit}' < /proc/modules 2>/dev/null)"
     if [ -n "$MODOUT" ]
     then
         return 2
@@ -257,7 +257,7 @@
     fi
     MODNAME="$1"
 
-    MODOUT="`awk '$1 ~ /^'$MODNAME'$/{print $1,$3;exit}' < /proc/modules 2>/dev/null`"
+    MODOUT="$(awk '$1 ~ /^'$MODNAME'$/{print $1,$3;exit}' < /proc/modules 2>/dev/null)"
     if [ -z "$MODOUT" ]
     then
         return 2
@@ -302,8 +302,8 @@
     TYPE="$1"
     MNTPT="$2"
     FULL_MOUNT="${O2CB_MANAGER}/${MNTPT}"
-    FULL_MOUNTSEARCH="`echo "$FULL_MOUNT" | sed -e 's/\//\\\\\//g'`"
-    MOUNTOUT="`awk '$2 ~ /^'$FULL_MOUNTSEARCH'$/{print $2; exit}' < /proc/mounts 2>/dev/null`"
+    FULL_MOUNTSEARCH="$(echo "$FULL_MOUNT" | sed -e 's/\//\\\\\//g')"
+    MOUNTOUT="$(awk '$2 ~ /^'$FULL_MOUNTSEARCH'$/{print $2; exit}' < /proc/mounts 2>/dev/null)"
 
     if [ -n "$MOUNTOUT" ]
     then
@@ -338,8 +338,8 @@
     TYPE="$1"
     MNTPT="$2"
     FULL_MOUNT="${O2CB_MANAGER}/${MNTPT}"
-    FULL_MOUNTSEARCH="`echo "$FULL_MOUNT" | sed -e 's/\//\\\\\//g'`"
-    MOUNTOUT="`awk '$2 ~ /^'$FULL_MOUNTSEARCH'$/{print $2; exit}' < /proc/mounts 2>/dev/null`"
+    FULL_MOUNTSEARCH="$(echo "$FULL_MOUNT" | sed -e 's/\//\\\\\//g')"
+    MOUNTOUT="$(awk '$2 ~ /^'$FULL_MOUNTSEARCH'$/{print $2; exit}' < /proc/mounts 2>/dev/null)"
 
     if [ -z "$MOUNTOUT" ]
     then
@@ -398,6 +398,11 @@
 
 start()
 {
+    if [ "$O2CB_ENABLED" != "true" ]
+    then
+        exit 0
+    fi
+
     load
     online "$2"
 }
@@ -478,7 +483,7 @@
         fi
 
         FULL_MOUNT="${O2CB_MANAGER}/${MOUNT_POINT}"
-        FULL_MOUNTSEARCH="`echo "$FULL_MOUNT" | sed -e 's/\//\\\\\//g'`"
+        FULL_MOUNTSEARCH="$(echo "$FULL_MOUNT" | sed -e 's/\//\\\\\//g')"
         if grep "^${FSTYPE} ${FULL_MOUNTSEARCH} ${FSTYPE}" /proc/mounts >/dev/null 2>&1
         then
             echo -n "${MOUNT_POINT} "



More information about the Ocfs2-tools-commits mailing list