Slim Server

This is my first blog so, don’t expect my blog to be free from english mistakes because technical guys are generally weak in communication and litreary .This first blog is about how to install the SLIM server which stands from Single Linux Image Management.Basically this is a article which I really found very much interested as a FOSS Lover……………..

A. Introduction

A Linux cluster is considered a single system which consists of a set of tightly coupled machines called nodes. In many cases, it is locked inside a room and people access it remotely via the network. Usually nodes are individually installed with the Linux OS manually. This creates much setup burden when the number of nodes is large.

SLIM (Single Linux Image Management) is a solution developed by the Department of Computer Science of HKU to ease the deployment and management of large-scale networked Linux systems. One of the goals of SLIM is to reduce the setup burden. This workshop teaches you how to setup, administer, and manage a SLIM environment for cluster computing. More information about SLIM can be found at the website http://slim.cs.hku.hk/.

The SLIM environment consists of a SLIM server to provide shared system resources via the network to the client PCs. Client PCs known as cluster nodes use network booting to start the Linux system locally.

In this workshop, we will use the Fedora Core 2 Linux distribution to setup the SLIM server to serve all the cluster nodes connected in a network. Figure 1 depicts the specific network topology we will use in this workshop.

The SLIM server is on the 10.0.1.0/255.255.255.0 private network. The IP address of the SLIM server is 10.0.1.254. This is the simplest form of the SLIM environment network. But it is powerful enough to build a Linux Cluster having tens of cluster nodes.

Pre-Requisite of RPM Software Packages

Since the setup of the SLIM server will need to provide NFS, TFTP and DHCP services, the following RPM software packages must be included with the Fedore Core 2 installation.

RPM package Description
nfs-utils-1.0.6-20 NFS utilities and supporting daemons for the kernel NFS server
tftp-server-0.33-3 Trivial File Transfer Protocol Server
dhcp-3.0.1rc12-4 DHCP Server
syslinux-2.08-3 Syslinux kernel loader which includes PXE network loader

The following command queries if the package tftp-server-0.33-3 is installed. If positive, it will produce the package information; otherwise it will report that <package tftp-server-0.33-3 is not installed>. So you can check if all the above packages are installed or not.

[root@localhost]# rpm -q -i tftp-server-0.33-3

In case that a package is missing, you can manually install it. You can download them from the FTP site (ftp://ftp.cs.hku.hk/pub/linux/fedora/linux/core/2/i386/os/Fedora/RPMS/) of Department of Computer Science. You can also find them on the Fedora Core 2 CDROM (under the directory Fedora/RPMS). The following is how you would install a package manually.

[root@localhost]# rpm -ih tftp-server-0.33-3.i386.rpm


B. Preparing the SLIM Server

Install the Fedora Core 2 as usual. Assume that you have all required RPM packages installed as described above. You need them to complete the following tasks.

1. Install the SLIM package

Installation of the SLIM package is easy. Copy it from given floppy diskette or download it from the website https://intranet.cs.hku.hk/slim/, Then, unpack the gzip-tar ball to any directory you like. Usually, it is put under the root’s home directory.

[root@localhost]# tar xvfz slim-v1.0e1.tar.gz

SLIM package contains the following utility programs for the administrator.

Utility Program Parameters it takes Description
mkroot.sh -k kernel version
-p full path to Linux system image
Construct mini-root file system for building initrd
mkinitrd.sh -k kernel version
-p full path to Linux system image
Based on output of mkroot.sh, it constructs initrd
install.sh none Install linux kernel and initrd generated by mkinitrd.sh to /tftpboot
imagesetup.sh full path of Linux system image Setup Linux system image

2. Building the Linux System Image

Building the system image for exporting to SLIM client PCs is simply a task to duplicate the SLIM server’s root file system in another partition or directory. In the example here, we put the OS image under the directory /linux/images/fc2.

Firstly, we find out what disk partitions Fedore Core 2 uses for the system.

[root@localhost]# df -F ext3

The output may look like the following.

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda1 99292 42352 15623516 27% /boot
/dev/hda2 14745472 2404620 11591824 18% /

We see that the system uses “/” and “/boot”.

The following command can replicate the system. It will take a short while to copy the system.

[root@localhost]# mkdir -p /linux/images/fc2 #make the directory
[root@localhost]# cp -x -a / /linux/images/fc2 #copy /

And

[root@localhost]# cp -x -a /boot /linux/images/fc2 #copy /boot

Finally, under the SLIM installation directory we run

[root@localhost]]# cd slim-v1.0e1
[root@localhost slim-v1.0e1]# ./imagesetup.sh /linux/images/fc2

3. Building SLIM initrd

The kernel version of Fedore Core 2 is 2.6.5-1.358. The path to the OS image we have just setup is /linux/images/fc2. Then, we do

[root@localhost slim-v1.0e1]# ./mkroot.sh -k 2.6.5-1.358 -p /linux/images/fc2
[root@localhost slim-v1.0e1]# ./mkinitrd.sh -k 2.6.5-1.358 -p /linux/images/fc2

Install kernel and initrd to /tftpboot

[root@localhost slim-v1.0e1]# ./install.sh

4. Setting Up the NFS Service

To provide NFS service for exporting the shared OS image at /linux/images/fc2, copy the “exports” file in the SLIM installation directory to /etc

[root@localhost slim-v1.0e1]# cp -a samples/nfs/exports /etc

The contents of exports file look like the following.

/linux/images/fc2 10.0.1.0/255.255.255.0(ro,async,no_root_squash,no_subtree_check)

Then, restart the NFS services

[root@localhost slim-v1.0e1]# /etc/init.d/nfs restart

And make it auto-start after rebooting.

[root@localhost slim-v1.0e1]# chkconfig nfs on

5. Setting Up the TFTP Service

To enable the TFTP service, edit /etc/xinetd.d/tftp and set the “disable” property to “no”; then restart xinetd.

[root@localhost slim-v1.0e1]# /etc/init.d/xinetd restart

6. Setting Up the PXE Boot Loader – pxelinux

SLIM clients use the PXE protocol to boot the Linux kernel and the associated initrd. The boot loader must be setup properly. We use pxelinux.

Copy the config file and the PXE boot loader in the SLIM installation directory to /tftpboot

[root@localhost slim-v1.0e1]# cp -a samples/tftpboot/* /tftpboot

At this point, the /tftpboot has

/tftpboot/vmlinuz-2.6.5-1.358
/tftpboot/initrd-2.6.5-1.358
/tftpboot/pxelinux.0
/tftpboot/pxelinux.cfg
/tftpboot/pxelinux.cfg/0A0001

The name of the boot loader is “pxelinux.0”.

A subdirectory named “pxelinux.cfg” under the tftpboot directory holds the config file for each network boot client PC.

The name of a config file is the hex number of the IP Address. It can be a subnet address or host address. For example, for all PCs in the private network of 10.0.1.0/255.255.255.0, the config file name will be 0A0001. For host address 10.0.1.1, the name will be 0A000101.

The contents of the config. file look like the following.

PROMPT 0
DEFAULT linux
LABEL linux
KERNEL vmlinuz-2.6.5-1.358
APPEND root=/dev/ram0 imageroot=10.0.1.254:/linux/images/fc2 initrd=initrd-2.6.5-1.358

pxelinux has the following basic commands.

Command Description
PROMPT whether to display the “boot:” prompt
DEFAULT Default boot item
LABEL Name the boot item
KERNEL Linux kernel to named boot item
APPEND Supply booting parameters to kernel of a boot item

Booting Parameters

A booting parameter takes the form of parameter-name=parameter-value (no space between any parts). They are passed to the APPEND command of the pxelinux boot loader. They are summarized in the following table.

Parameter Value Mandatory Desciption
root /dev/ram0 Yes For diskless Linux, use main memory to hold root file system.
imageroot IP Address:/path
e.g. 10.0.1.254:/linux/images/fc2
Yes IP address of NFS server and
the full path of exported system image
initrd File name of initrd
e.g. initrd-2.6.5-1.358
Yes Specify initrd that boots with kernel
swapdev partiton device
e.g. /dev/hda2
No Partition to be swap memory
rescue “yes”, “true” No Activiate rescue mode, useful for debug