Thursday, August 21, 2008

Building Up a Cluster Computer......

Intel Pentium IV 3.2GHz with HT technology - 4
Intel 915G Motherboard - 4
512 MB DDR (400 MHz FSB) - 4
Power Supply 300W - 4
Seagate 7200RPM 80 GB HDD - 1
DVD/CD Drive - 1
Ethernet Cards (10/100 ) - 4
8 Port Ethernet Switch - 1


Software Requirements
------------------------

As for the Operating System we used Debian Etch (kernel version 2.6.18-4-686)
Its your choice. You can even use UBUNTU. The configuration is somewhat same for both.
But we will be referring Debian Etch in this article.


Arrangement
--------------

We will have one master node and three slave nodes. The master node will be the only one having access to a Hard disk drive and a DVD/CD drive. The slave nodes will have their processors, motherboards, RAM and Power supply. All installations have to be made in the master node and exported to the slave nodes via NFS. All the nodes are assembled separately and wired using CAT6e cables via the Switch and ethernet cards. That's up to you....



1.Installation
-----------------------

First step is to install the OS to the head node(master node).
Put the Debian Etch CD in to the Drive and boot into the Installation Procedure.
The partitioning of the was done as follows...

/ - 20 GB
/home - 26 GB
Node partitions - 11 GB x 3 (these are the ones thats gonna be exported via NFS)
Swap - 1 GB


You can change these according to your wish.


Finish the Installation Procedure for the Master Node.


Now for the slave node installation...
The OS for the slave nodes are installed in the Master Node..
Start the Installation Procedure for the slave nodes by booting up from the Debian Etch CD/DVD. This time the installation is to be made by keeping one of those 11 GB partitions we made as the root(/) Partition....

"DO NOT INSTALL THE BOOT LOADER THIS TIME......VERY IMPORTANT "

You can repeat this installation procedure two more times to install the OS for the two other nodes....(Pls donot install the GRUB BOOT LOADER)....

So you are done installing the OS...



2.CONFIGURATION OF NODES
---------------------------------------------------


a)Mounting the three / partitions

Mount the partitions for the slave nodes to following directories by editing /etc/fstab.lst

drives are mounted to /nodes/nfs/node1 , /nodes/nfs/node2 , /nodes/nfs/node3

Our /etc/fstab is as follows:


/dev/sda7 /nodes/nfs/node1 ext3 defaults 0 0
/dev/sda8 /nodes/nfs/node2 ext3 defaults 0 0
/dev/sda9 /nodes/nfs/node3 ext3 defaults 0 0


make sure the /etc/fstab of the nodes(/nodes/nfs/node'x'/etc/fstab) are also edited.....

IMPORATANT : The option part must be set to 'defaults' .


b)Installing NFS Utilities
--------------------------------------

apt-get install nfs-common nfs-kernel-server


Edit /etc/exports

add following lines:


/nodes/nfs/node1 192.168.0.0/24(rw,no_root_squash,sync,no_subtree_check)
/nodes/nfs/node2 192.168.0.0/24(rw,no_root_squash,sync,no_subtree_check)
/nodes/nfs/node3 192.168.0.0/24(rw,no_root_squash,sync,no_subtree_check)
/nodes 192.168.0.0/24(rw,no_root_squash,sync,no_subtree_check)
/home 192.168.0.0/24(rw,no_root_squash,sync,no_subtree_check)


c)DHCP Server Installation
---------------------------------------------

apt-get install dhcp

Configure /etc/dhcpd.conf

authoritative;
option domain-name "project"
option subnet mask 255.255.255.0
next server 192.168.0.20; #TFTP Server
filename "/tftpboot/pxelinux.0";

subnet 192.168.0.0 netmask 255.255.255.0{
range 192.168.0.20 192.168.0.25;
option domain-name-servers 192.168.0.1
option broadcast-address 192.168.0.255;
}

host node1{
hardware ethernet MAC_ID OF NODE1; #give mac id of node 1's ethernet card
fixed address 192.168.0.21;
option root-path "/nodes/nfs/node1";
}
host node2{
hardware ethernet MAC_ID OF NODE2; #give mac id of node 2's ethernet card
fixed address 192.168.0.22;
option root-path "/nodes/nfs/node2";
}
host node3{
hardware ethernet MAC_ID OF NODE3; #give mac id of node 3's ethernet card
fixed address 192.168.0.23;
option root-path "/nodes/nfs/node3";
}



d)Installing TFTP
-----------------------------

apt-get install atftpd xinetd

Configure atftpd

open a file an add the following lines.

service tftp
{
disable=no
socket_type=dgram
protocol=udp
wait=yes
use=nobody
server=/usr/sbin/in.tftpd
server_args = --tftpd-timeout 300 --retry-timeout 5
--mcast-port 1758 --mcast-addr 239.239.239.0-255
--mcast-ttl 1 --maxthread 100 --verbose=5 /tftpboot
}



e)Create /tftpboot folder

mkdir /tftpboot
chmod 777 /tftpboot


f)Configuring PXE
-------------------------------

A. (i) Download PXElinux. from http://syslinux.zytor.com/pxe.php.
(ii) Find the file pxelinux.0 from the tarball and copy it to /tftpboot.

B. Generate initial ramdisk and put it along with the kernel image in the /tftpboot directory using following steps:
(i) Change root to /nodes/nfs/node1 : sudo chroot /nodes/nfs/node1 /bin/bash
(ii) Goto /etc/initramfs-tools and edit initramfs.conf
Set 'BOOT=nfs ' in the file.
(iii) Update initramfs by : sudo update-initramfs -u
(iv) Exit from the changed root(type 'exit') and copy the kernel image and initramfs from /nodes/nfs/node1/boot to /tftpboot (Here KERNEL_VERSION is to be repalced with the version of the kernel(can be found out using 'uname -r')):
sudo cp /nodes/nfs/node1/boot/initrd.img-KERNEL_VERSION /tftpboot/
sudo cp /nodes/nfs/node1/boot/vmlinuz-KERNEL_VERSION /tftpboot/

C. Create the folder /tftpboot/pxelinux.cfg
Create files in this folder with name as 01-xx-xx-xx-xx-xx-xx, where xx-xx-xx-xx-xx-xx is the Mac id of the network card of the nodes.

Edit the contents of the files as follows.(KERNEL_VERSION is to be the version of the kernel and 'x' should be replaced with the node number.

default linux
label linux
kernel vmlinuz-KERNEL_VERSION
append initrd=initrd.img-KERNEL_VERSION
nfsroot=192.168.2.1:/nodes/nfs/nodex


All the configurations are performed. Now reboot the system and change the boot device to Network boot in the BIOS.

If all goes right the cluster should be up and running.

Then you could install the PVM libraries or Open MPI to do the parallel processings.

ROCK ON!!!!!

No comments: