RHEL5 NFS Shared Root Mini Howto
This mini howto describes the steps needed to build a RHEL5 NFS based sharedroot Cluster
Installation Options
Manual Installation
You can also manually install the Open Shared Root Cluster. Please follow the instructions of this manual to do so.
Prerequisites
to be defined
Install Com.oonics packages
Install the latest comoonics rpms from a comoonics redhat-el5 yum channel:
yum install comoonics-bootimage comoonics-cdsl-py comoonics-bootimage-extras-nfs comoonics-bootimage-listfiles-rhel5
You might also need other packages if needed use yum list comoonics
Create a cluster configuration file
Create a cluster configuration file /etc/cluster/cluster.conf with the com_info tags.
Note, that the following cluster configuration still needs a valid fencing configuration for a properly working cluster:
<?xml version="1.0"?>
<cluster config_version="1" name="axqad108" type="gfs">
<clusternodes>
<clusternode name="node1" nodeid="1" votes="1">
<com_info>
<rootvolume fstype="nfs" name="192.168.122.1:/home/marc/virtual/nfsosr/axqad108"/>
<eth name="eth0" ip="192.168.122.161" mac="00:0C:29:C9:C6:F5" mask="255.255.255.0" gateway="192.168.122.1"/>
<fenceackserver user="root" passwd="test123"/>
</com_info>
<fence>
<method name="1"/>
</fence>
</clusternode>
<clusternode name="node2" nodeid="2" votes="2">
<com_info>
<rootvolume fstype="nfs" name="192.168.122.1:/home/marc/virtual/nfsosr/axqad108"/>
<eth name="eth0" ip="192.168.122.162" mac="00:0C:29:C9:C6:F5" mask="255.255.255.0" gateway="192.168.122.1"/>
<fenceackserver user="root" passwd="test123"/>
</com_info>
<fence>
<method name="1"/>
</fence>
</clusternode>
</clusternodes>
</cluster>
Create the shared root filesystem
The shared root filesystem must be a moutable nfs export as a shared nfs resource.::
Mount the new filesystem to '/mnt/newroot':
mount -t nfs -o nolock 192.168.122.1:/home/marc/virtual/nfsosr/axqad108 /mnt/newroot/
(The nolock mountoption has been introduced because of issues regarding the cdsl tree creation.)
Copy all data from the local installed RHEL5 root filesystem to the shared root filesystem:
cp -ax / /mnt/newroot/
Create some directories if need be:
mkdir /mnt/newroot/proc
mkdir /mnt/newroot/sys
Create a new cdsl infrastructure on the shared root filesystem:
com-mkcdslinfrastructure -r /mnt/newroot
Mount the local cdsl infrastructure:
mount --bind /mnt/newroot/.cluster/cdsl/1/ /mnt/newroot/.cdsl.local/
Make /var subdirs hostdependent:
chroot /mnt/newroot
com-mkcdsl -a -f /var/tmp/
com-mkcdsl -a -f /var/account
com-mkcdsl -a -f /var/cache
com-mkcdsl -a -f /var/local
com-mkcdsl -a -f /var/lock
com-mkcdsl -a -f /var/log
com-mkcdsl -a -f /var/spool
com-mkcdsl -a -f /var/run
com-mkcdsl -a -f /var/lib/dbus
com-mkcdsl -a -f /var/lib/dhclient
If you are planning to use the multipathd follow the instructions to be found here .
Make /etc/sysconfig/network hostdependent:
chroot /mnt/newroot com-mkcdsl -a /etc/sysconfig/network
Create /etc/mtab link to '/proc/mounts':
cd /mnt/newroot/etc/
rm -f mtab
ln -s /proc/mounts mtab
Remove cluster network configuration:
rm -f /mnt/newroot/etc/sysconfig/network-scripts/ifcfg-eth0
Disable kudzu:
chroot /mnt/newroot/ chkconfig kudzu --del
Modify '/mnt/newroot/etc/fstab':
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
Create boot configuration based on PXE or any other possibility.
Create Shared Root initrd
Create the shared root initrd into the shared boot filesystem:
/opt/atix/comoonics-bootimage/mkinitrd -f /mnt/newroot/boot/initrd_sr-$(uname -r).img $(uname -r)
Boot Cluster
Have Fun !!