|
From KerrighedThis page describes how to use NFSROOT to deploy the Kerrighed system on a cluster.
[edit] PresentationThe main idea consists in using a NFS server which exports the Kerrighed environment. Client nodes do not need to have any harddisk devices attached to take part in a cluster session. All kinds of data (e.g. modules, special files, configuration files, etc.) needed at runtime are being provided by NFS. A NFS serves a local '/' directory that can be mounted by the remote (NFS) clients. In this setup, the NFS server must NOT be part of the cluster. Thus it does not need to run a Kerrighed kernel.
[edit] Pre-requisites
You may use a dedicated tool to create a basic Linux system. On Debian this tool is called debootstrap. [edit] Configure the server
# Default fot tftpd-hpa RUN_DAEMON = "yes" OPTIONS = '-l -s /srv/tftp' where /srv/tftp is the place you store kernel, ramdisk and GRUB configuration files for clients.
Fortunately, we have some precompiled versions of GRUB with network enabled on our download web space. Each pxegrub is suffixed with the name of the driver compiled with.
### PART 1
# GRUB magic
option grub-menu code 150 = string;
# General options
option dhcp-max-message-size 2048;
use-host-decl-names on;
deny unknown-clients;
deny bootp;
### PART 2
option domain-name "mycluster.home";
option domain-name-servers 123.123.123.123, 124.124.124.124;
option ntp-servers ntp.network.net;
### PART 3
subnet 192.168.0.0 netmask 255.255.255.0 {
option routers 192.168.0.1;
option broadcast-address 192.168.0.255;
}
### PART 4
group {
filename "/pxegrub";
option grub-menu = concat("(nd)/grub/", host-decl-name);
option root-path "/NFSROOT/kerrighed";
host ssi1 { fixed-address 192.168.0.101; hardware ethernet xx:xx:xx:xx:xx:xx; }
host ssi2 { fixed-address 192.168.0.102; hardware ethernet xx:xx:xx:xx:xx:xx; }
host ssi3 { fixed-address 192.168.0.103; hardware ethernet xx:xx:xx:xx:xx:xx; }
host ssi4 { fixed-address 192.168.0.104; hardware ethernet xx:xx:xx:xx:xx:xx; }
}
In this example:
/NFSROOT/kerrighed *(ro,async,no_root_squash,no_subtree_check) /NFSROOT/kerrighed/tmp *(rw,sync,no_root_squash,no_subtree_check) /NFSROOT/kerrighed/var *(rw,sync,no_root_squash,no_subtree_check) /NFSROOT/kerrighed/dev *(rw,sync,no_root_squash,no_subtree_check) /NFSROOT/kerrighed/root *(rw,sync,no_root_squash,no_subtree_check) Note: the base directory (/NFSROOT/kerrighed) is exported read-only.
/etc/init.d/dhcp3-server restart /etc/init.d/tftp-hpa restart /etc/init.d/nfs-kernel-server restart [edit] Create the base systemIn this chapter, we describe the creation of a NFSROOT base system, without Kerrighed.
mkdir /NFSROOT
debootstrap sid /NFSROOT/kerrighed http://ftp.debian.org/debian
chroot /NFSROOT/kerrighed
passwd
mount -t proc none /proc
apt-get install dhcp3-common nfs-common nfsbooted nfsbooted can assign different hostnames to each node of your cluster by resolving IP address attributed to your node.
apt-get install initramfs-tools
# A swap partition /dev/hda none swap sw 0 0 none /proc proc defaults 0 0 none /sys sysfs defaults 0 0 # # NFSROOT # Following partitions are mounted in rw mode, for the moment, I have # some troubles with lockd daemon that's why I added the 'nolock' params 192.168.0.1:/NFSROOT/kerrighed/dev /dev nfs rw,hard,nolock 0 0 192.168.0.1:/NFSROOT/kerrighed/var /var nfs rw,hard,nolock 0 0 192.168.0.1:/NFSROOT/kerrighed/tmp /tmp nfs rw,hard,nolock 0 0 192.168.0.1:/NFSROOT/kerrighed/root /root nfs rw,hard,nolock 0 0 # # TMPFS none /var/run tmpfs defaults 0 0
ln -sf ../network/if-up.d/mountnfs /etc/rcS.d/S35mountnfs
127.0.0.1 localhost.localdomain localhost 192.168.0.1 server.mycluster.home server 192.168.0.101 ssi1.mycluster.home ssi1 192.168.0.102 ssi2.mycluster.home ssi2 192.168.0.103 ssi3.mycluster.home ssi3 192.168.0.104 ssi4.mycluster.home ssi4
[edit] Configure nodes bootOnce your server is configured and your base system is ready, you can set up your nodes to boot with the base system.
cp /NFSROOT/kerrighed/boot/vmlinuz-xxx /NFSROOT/kerrighed/boot/initrd-xxx \ /srv/tftp
mkdir /srv/tftp/grub
timeout 1 title Debian on my server root (nd) kernel /vmlinuz-xxx root=/dev/nfs ip=dhcp nfsroot=192.168.0.1:/NFSROOT/kerrighed initrd /initrd.img-xxx
[edit] (Not so) Common problems and solutions
/NFSROOT/kerrighed *(rw,async,no_root_squash,no_subtree_check) Note: the base directory (/NFSROOT/kerrighed) is the only export for Kerrighed and not read-only any more.
# Turned off, as eth0 is already configured when using NFSROOT #auto eth0 #iface eth0 inet dhcp
> /etc/init.d/nfs-kernel-server stop
> rm -f /var/lib/nfs/etab /var/lib/nfs/rmtab \
/var/lib/nfs/state /var/lib/xtab
> touch /var/lib/nfs/etab /var/lib/nfs/rmtab \
/var/lib/nfs/state /var/lib/xtab
> chmod 644 /var/lib/nfs/etab /var/lib/nfs/rmtab \
/var/lib/nfs/state /var/lib/xtab
> /etc/init.d/nfs-kernel-server start
Thus, a line like: /NFSROOT/kerrighed 192.168.1.* (ro,async,no_root_squash,no_subtree_check) is not valid and should be replaced by something like: /NFSROOT/kerrighed 192.168.1.0/24 (ro,async,no_root_squash,no_subtree_check) As said in RedHat Reference Manual about NFS, "Wildcards should not be used with IP addresses; however, it is possible for them to work accidentally if reverse DNS lookups fail." |