Personal tools
You are here: Home Documentation RHEL5 GFS Shared Root Mini Howto
Document Actions

RHEL5 GFS Shared Root Mini Howto

This mini howto describes the steps needed to build a RHEL5 GFS based sharedroot Cluster

Installation Options

Installation DVD

You can use the latest Open Shared Root Cluster installation DVD. Please follow this link for more information.

Manual Installation

You can also manually install the Open Shared Root Cluster. Please follow the instrauctions of this manual to do so.

Prerequisites

Freshly installed RHEL5 with all cluster components.

Install Cluster Components:

    yum install cman gfs-utils kmod-gfs lvm2-cluster 

Enable lvm2 clustering:

    lvmconf --enable-cluster

Install Com.oonics packages

Install the latest comoonics rpms from a comoonics redhat-el5 yum channel:

    yum install comoonics-bootimage comoonics-cdsl-py

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 follwoing cluster configuration still needs a valid fencing configuration for a properly working cluster:

    <?xml version="1.0"?>
    <cluster config_version="3" name="clurhel5">
        <cman expected_votes="1"/>
        <fence_daemon post_fail_delay="0" post_join_delay="3"/>
        <clusternodes>
                <clusternode name="node1" nodeid="1" votes="1">
                        <com_info>
                                <syslog name="syslog-server"/>
                                <rootvolume name="/dev/vg_clurhel5_sr/lv_sharedroot"/>
                                <eth name="eth0" ip="10.0.10.1" mac="00:0C:29:C9:C6:F5" mask="255.255.255.0" gateway=""/>
                                <fenceackserver user="root" passwd="test123"/>
                        </com_info>
                        <fence>
                                <method name="1"/>
                        </fence>
                </clusternode>
                <clusternode name="node2" nodeid="2" votes="2">
                        <com_info>
                                <syslog name="syslog server"/>
                                <rootvolume name="/dev/vg_clurhel5_sr/lv_sharedroot"/>
                                <eth name="eth0" ip="10.0.10.2" mac="00:0C:29:1B:ED:49" mask="255.255.255.0" gateway=""/>
                                <fenceackserver user="root" passwd="test123"/>
                        </com_info>

                        <fence>
                                <method name="1"/>
                        </fence>
                </clusternode>
        </clusternodes>
        <fencedevices/>
        <rm>
                <failoverdomains/>
                <resources/>
        </rm>
    </cluster>

Create the shared root filesystem

The shared root filesystem must be a logical volume on a shared storage device. Use gfs_mkfs to create the GFS filesystem:

    gfs_mkfs -j 4 -p lock_dlm -t clurhel5:root /dev/vg_clurhel5_sr/lv_sharedroot 

Mount the new filesystem to '/mnt/newroot':

    mount -t gfs -o lockproto=lock_nolock /dev/vg_clurhel5_sr/lv_sharedroot /mnt/newroot/  

Copy all data from the local installed RHEL5 root filesystem to the shared root filesystem:

    cp -ax / /mnt/newroot/

Create some directories:

    mkdir /mnt/newroot/proc
    mkdir /mnt/newroot/sys

Create a new cdsl infrastructure on the shared root filesystem:

    com-mkcdslinfrastructure -r /mnt/newroot -i

Mount the local cdsl infrastructure:

    mount --bind /mnt/newroot/cluster/cdsl/1/ /mnt/newroot/cdsl.local/

Make /var hostdependent:

    com-mkcdsl -r /mnt/newroot -a /var 

Make /var/lib shared again:

    com-mkcdsl -r /mnt/newroot -s /var/lib

Make /etc/sysconfig/network hostdependent:

    com-mkcdsl -r /mnt/newroot -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':

    #/dev/vg_clurhel5_sr/lv_sharedroot  /           gfs     defaults        0 0
    #LABEL=/boot             /boot                   ext3    defaults        1 2
    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
   /dev/vg_system/lv_swap  swap                    swap    defaults        0 0

Create shared bootdevice

Mount shared boot:

    mount /dev/sdb1 /mnt/newroot/boot/

Copy boot:

    cp -a /boot/* /mnt/newroot/boot

create '/mnt/newroot/boot/grub/grub.conf':

    default=0
    timeout=5
    hiddenmenu
    title Red Hat Enterprise Linux Server SharedRoot     (2.6.18-8.1.8.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-8.1.8.el5 ro rhgb quiet    crashkernel=128M@16M com-debug
        initrd /initrd_sr-2.6.18-8.1.8.el5.img

Invoke grub shell:

    grub

Install grub:

    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

     [ Minimal BASH-like line editing is supported.  For the first word, TAB
       lists possible command completions.  Anywhere else TAB lists the possible
       completions of a device/filename.]

    grub> device (hd0) /dev/sdb

    grub> root (hd0,0)
     Filesystem type is ext2fs, partition type 0x83

    grub> setup (hd0)
     Checking if "/boot/grub/stage1" exists... no
     Checking if "/grub/stage1" exists... yes
     Checking if "/grub/stage2" exists... yes
     Checking if "/grub/e2fs_stage1_5" exists... yes
     Running "embed /grub/e2fs_stage1_5 (hd0)"...  15 sectors are embedded.
    succeeded
     Running "install /grub/stage1 (hd0) (hd0)1+15 p     (hd0,0)/grub/stage2 /grub/grub.conf"... succeeded
    Done.

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 !!


Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: