[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] Submitting lvm-cluster resource script



Hi,

I previously submitted this to the list in the following thread:

https://www.redhat.com/archives/cluster-devel/2009-June/msg00020.html

I just want to submit a new version, the diff patch against the previous
version (which can be found in the older thread) and a readme file to
help people in the deployment and usage of the lvm-cluster resource
script.

md5sums:

fe6bf8a73ab059231172210f299f943d  lvm-cluster.sh
5c6679317e90af5c3cf933d972df20bb  patch-v1
f1dcd80729066bf57cc6743a16fcb261  README.txt

Cheers,

Rafael

-- 
Rafael Micó Miranda

Attachment: lvm-cluster.sh
Description: application/shellscript

--- old/lvm-cluster.sh	2009-10-05 23:17:35.809365184 +0200
+++ new/lvm-cluster.sh	2009-10-05 23:08:36.389362630 +0200
@@ -1,8 +1,13 @@
 #!/bin/bash
 
 #
+#
 #  Copyright Red Hat, Inc. 2002-2004
 #  Copyright Mission Critical Linux, Inc. 2000
+#  Copyright Rafael Mic Miranda, 2009. (rmicmirregs [at] gmail (dot) com)
+#
+#	Version 1: October 2009. Minor fixes
+#	Version 0: June 2009. Original release
 #
 #  This program is free software; you can redistribute it and/or modify it
 #  under the terms of the GNU General Public License as published by the
@@ -36,13 +41,13 @@
 
 meta_data()
 {
-    cat <<EOT
+    $CAT <<EOT
 <?xml version="1.0" ?>
 <resource-agent name="lvm-cluster" version="rgmanager 2.0">
     <version>1.0</version>
 
     <longdesc lang="en">
-	This defines a LVM CLUSTER volume group that is ...
+	LVM volume resource script for clusters, with ability to get exclusive access of LogVols.
     </longdesc>
 
     <shortdesc lang="en">
@@ -92,31 +97,6 @@
 	    <content type="boolean"/>
 	</parameter>
 
-<!--	<parameter name="self_fence">
-	    <longdesc lang="en">
-		If set and the clean up of the tags fails, the node will
-		immediately reboot.
-	    </longdesc>
-	    <shortdesc lang="en">
-		Fence the node if it is not able to clean up LVM tags
-	    </shortdesc>
-	    <content type="boolean"/>
-	</parameter>
--->
-
-<!--	<parameter name="nfslock" inherit="service%nfslock">
-	    <longdesc lang="en">
-	        If set and unmounting the file system fails, the node will
-		try to kill lockd and issue reclaims across all remaining
-		network interface cards.
-	    </longdesc>
-	    <shortdesc lang="en">
-	        Enable NFS lock workarounds
-	    </shortdesc>
-	    <content type="boolean"/>
-	</parameter>
--->
-
     </parameters>
 
     <actions>
@@ -320,10 +300,11 @@
 SED=/bin/sed
 LVCHANGE=/usr/sbin/lvchange
 SLEEP=/bin/sleep
+CAT=/bin/cat
 
 # Check to make sure the utilites are found
 
-for util in $VGS $LVS $ECHO $SED $LVCHANGE $SLEEP
+for util in $VGS $LVS $ECHO $SED $LVCHANGE $SLEEP $CAT
 do
 	if ! check_util $util
 	then
GENERAL INFORMATION:

LVM volume resource script for clusters, with ability to get exclusive access of
Logical Volumes. 
This is intended to be used with non-clustered filesystems, such as EXT3.

This way, you can define cluster services with filesystem resources with a 
protection to avoid the filesystems being mounted, by hand, in more than one 
node, avoiding corruption.

Tested and developed on:

RedHat Enterprise Linux 5.3 x86_64
cman-2.0.98-1.el5.x86_64
openais-0.80.3-22.el5.x86_64
rgmanager-2.0.46-1.el5.x86_64
lvm2-cluster-2.02.40-7.el5.x86_64

INSTALLATION:

Jut copy "lvm-cluster.sh" resource script into your resource scripts 
directory, usually /usr/share/cluster/

Keep an eye on the rights of the file just to be the
same as the others in the dir.

USAGE:

As part of the use of the lvm-cluster.sh resource script, you need to:

1.- Configure your multipathing software

2.- Configure properly the locking_type into lvm.conf to type 3 in all your 
systems.

3.- Create your Physical Volumes (PVs)

4.- Configure your Volume Groups (VGs) as clustered Volume Groups

5.- Create your Logical Volumes (LVs) into the clustered Volume Groups

6.- And, and the not so obvious, de-activate all the Logical Volumes you
plan to use as exclusive Logical Volumes (using exclusive flag).

De-activation can be done with "vgchange -an volgrp01/logvol01" or
similar command.

EXAMPLES:

Example of cluster.conf file content:

[...]
<resources>
	<ip address="172.26.2.1" monitor_link="1"/>
	<lvm-cluster name="logvol01" vg_name="volgrp01" lv_name="logvol01" exclusive="yes"/>
	<fs device="/dev/volgrp01/logvol01" force_fsck="1" force_unmount="1" fsid="40231" fstype="ext3" mountpoint="/imports/vol01" name="Filesystem01" options="" self_fence="1"/>
	<nfsexport name="/imports/vol01"/>
	<nfsclient name="Clients01" options="fsid=1001,async,no_root_squash,rw,mountpoint=/imports/vol01" path="/imports/vol01" target="172.26.0.80"/>
</resources>
<service autostart="1" domain="failoverdomain01" name="service01" recovery="restart">
	<lvm-cluster ref="logvol01">
		<fs ref="Filesystem01">
			<nfsexport ref="/imports/vol01">
				<nfsclient ref="Clients01"/>
			</nfsexport>
			<ip ref="172.26.2.1"/>
		</fs>
	</lvm-cluster>
</service>
[...]

CONTACT THE AUTHOR:

Send comments or feedback to Rafael Mic (rmicmirregs [at] gmail (dot) com)
	
-EOF-

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]