Creating a diskless cluster
From Unofficial BOINC Wiki
To create a BOINC distributed network cluster running from an NFS server you need the following:
- 1 or more boot servers (TFTP)
- A DHCP server (Static or otherwise)
- However many network clients you plan to run.
This tutorial is designed for Debian-based Linux such as Ubuntu. This tutorial assumes you know Unix/Linux system administration.
Contents |
[edit] Step 1 - Set up the DHCP server
- First of all, you need to install dhcpd if it is not already on the system
apt-get install dhcp
- Next, modify /etc/dhcpd.conf to reflect your network. See the man page for more info.
- Finally, start the dhcp server by typing
/etc/init.d/dhcp start
[edit] Step 2 - Creating the NFS system
- First of all, install the NFS server
apt-get install nfs-kernel-server
- Now, create a new folder on the server to house the root of the OS.
- Configure /etc/exports to export the folder, and then run
/etc/nfs-kernel-server restart
- Now it's time to install the root system. Find out the debootstrap parameters for the OS you want to use (I'm using Ubuntu here).
- Install debootstrap
apt-get install debootstrap
- As root, run debootstrap with the parameters that you discovered earlier, replacing the path with the path you wish to install into.
sudo debootstrap --arch i386 edgy /media/DATA/x64 http://archive.ubuntu.com/ubuntu
[edit] Step 3 - Configuring TFTPD
- TFTPD needs little to be configured, you just need to have it installed, and know its data folder. I'm using tftp-hpa.
- It does, however, need to be installed.
apt-get install tftpd-hpa
[edit] Step 4 - Configuring the loader
- The loader to use for network booting is called PXElinux. It is one file called pxelinux.0 and is part of syslinux.
- Next, add the following for your network section in /etc/dhcpd.conf
next-server {SERVER IP}
filename "pxelinux.0"
- Finally restart dhcpd
/etc/init.d/dhcp restart
[edit] Step 5 - Compiling the kernel
- Enable all the network card options (set to 'y') in
make menuconfig
- It was only recently that the kernel supported NFS booting. I was using linux-2.6.18.2 for my run, and I had to enable the following options manually after having configured the kernel.
CONFIG_NFS_FS=y CONFIG_ROOT_NFS=y CONFIG_IP_PNP=y CONFIG_IP_PNP_DHCP=y CONFIG_IP_PNP_BOOTP=y CONFIG_IP_PNP_RARP=y
- Then build the kernel.
make bzImage
- Copy the resulting bzImage file (under boot/i386 for 32 bit and boot/amd64 for 64 bit) to the tftp root and call it bzImage-netboot or something you will remember.
[edit] Step 6 - PXELinux.cfg
- PXELinux supports booting a different kernel depending on the MAC address of the network card.
- Assuming all your machines are identical, you can just create a defaults file (Replace {TFTPROOT} with the root of your TFTP dir).
cd {TFTPROOT}
mkdir pxelinux.cfg
cd pxelinux.cfg
emacs default
- Now, carefully type in the following (replacing NFSROOT with the "{NFS server IP}:/path/to/debootstrapped/os"):
DEFAULT bzImage-netboot ip=dhcp root=/dev/nfs nfsroot={NFSROOT}
[edit] Step 7 - Check for errors
- PXE/Network Boot one of the machines. It should load linux, and you should be presented with a login screen/terminal.
- If all went to plan, then great, move on.
- If not, check permissions, whether you actually exported the folders etc.
[edit] Step 8 - Configure your users
- On the NFS server, chroot to the os folder, and type:
apt-get update apt-get install emacs
- Now, add a user (replace {username} with the user name to add} with a password.
useradd -s /bin/bash {username}
passwd {username}
[edit] Step 9 - Installing BOINC
- If, as on Ubuntu, you cannot log in as root, but know root's password, log in as a normal user which you created above, then type
sudo su
to get a root prompt.
- Download BOINC (or compile from source).
wget http://boinc.berkeley.edu/dl/boinc_5.4.9_i686-pc-linux-gnu.sh
- Download the boinc cluster tools [1]
- Extract boinc cluster tools to /usr/local/bin or /usr/bin
- Run (at a shell)
boinc_install /path/to/boinc/installer
- Then, you need to run
boinc_mkhost HOSTIP
replacing HOSTIP with the host's IP address
- Finally, add the script boincip to startup, reboot and watch boinc start up.

