Setting up the Master Node

The Box cluster machine does not have a CD-ROM drive. One option is to attach a CD/DVD drive to the SATA slot. The other option is to boot this node through netboot (PXE). To do this, we should use another machine. In our case, we use the first option - viz. adding a CD-ROM drive.

After this, we setup a) a DHCP server, b) NFS server, c) PXE boot server and d) web server.

We need to do some network setup for IP masquerading and configuration of the Fully Automated Install using Kickstart as well.

DHCP server

A DHCP server is needed to dynamically assign IP addresses to the slave-nodes during the PXE boot process. We install it using

apt-get install dhcp3-server

We use the following configuration in /etc/dhcp/dhcpd.conf

ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
ddns-update-style none;
subnet netmask {
     default-lease-time 86400;
     max-lease-time 604800;
     option routers;
     option subnet-mask;
     option domain-name "local";
     option domain-name-servers;
     option nis-domain "hpc";
     option broadcast-address;
     allow booting;
     allow bootp;
     if (substring (option vendor-class-identifier, 0, 20)
                     = "PXEClient:Arch:00002") {
             # ia64
             filename "elilo.efi";
     } elsif ((substring (option vendor-class-identifier, 0, 9)
                     = "PXEClient") or
             (substring (option vendor-class-identifier, 0, 9)
                     = "Etherboot")) {
             # i386 and x86_64
             filename "pxelinux.0";
     } else {
             filename "/install/sbin/kickstart.cgi";

    host hpcs02 {
        hardware ethernet 00:15:17:31:11:00;
        option host-name "hpcs02";
    host hpcs03 {
        hardware ethernet 00:15:17:31:0D:8C;
        option host-name "hpcs03";
# and so on .........

We should edit /etc/network/interfaces and add the following

auto eth1
iface eth1 inet static

Now restart the network and the dhcp server

service networking restart
service isc-dhcp-server restart

More network configuration

Edit /etc/hosts to include all the nodes. For example	localhost hpcs01 hpcs02 hpcs03 hpcs04 hpcs05 hpcs06 hpcs07

Also create a text file in /etc/machines with the names of all the slave nodes for example. We will use this for scripting common tasks across the nodes.


PXE boot server

Install tftpd-hpa: apt-get install tfptd-hpa

Edit /etc/default/tfptd-hpa to include: #Defaults for tftpd-hpa RUN_DAEMON=”yes” OPTIONS=”-l -s /var/lib/tftpboot”

Now download the netboot file for Ubuntu amd64 from

For example cd /var/lib/tftpboot wget

     tar xvzf netboot.tar.gz

Restart the service: service tftpd-hpa restart

Web server

apt-get install apache2

NFS server

Install the packages: apt-get nfs-common nfs-kernel-server

Edit /etc/exports to export /home and /var/lib/tftpboot:


Export these files with exportfs -av

IP Masquerading

First edit /etc/sysctl.conf and uncomment the following line net.ipv4.ip_forward=1

Follow this by sudo sysctl -p

For IP masquerading we use sudo iptables -t nat -A POSTROUTING -s -p eth0 -j MASQUERADE

iptables-save > /etc/network/iptables

For permanent IP masquerading, append the following to /etc/network/interfaces as follows

auto eth1
iface eth1 inet static
up iptables-restore < /etc/network/iptables

Fully Automated Install Using Kickstart

We use the following Kickstart file which is placed at /var/www/ubuntu/ks.cfg

#Generated by Kickstart Configurator

#System language
lang en_US
#Language modules to install
langsupport en_US
#System keyboard
keyboard us
#System mouse
#System timezone
timezone --utc Asia/Tokyo
#Root password
rootpw --disabled
#Initial user
user terasaka --fullname "Haruo Terasaka" --iscrypted --password cryptedPass
#Reboot after installation
#Install OS instead of upgrade
#Use Web installation
#url --url
# see if we can use apt-cacher
url --url
#System bootloader configuration
bootloader --location=mbr 
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
part / --fstype ext4 --size 1 --grow
part swap --recommended
#System authorization infomation
auth  --useshadow  --enablemd5
#Network information
network --bootproto=dhcp --device=eth0
#Firewall configuration
firewall --disabled
#Do not configure the X Window System

To let the install process to use the kickstart file, we do the following: Delete the original contents of the /var/lib/tftpboot/pxelinux.cfg/default
file and replace with the following

default myinstall
prompt 0
label myinstall
   SAY Now booting from PXELINUX ...
        kernel ubuntu-installer/amd64/linux
        append ks= vga=788 initrd=ubuntu-installer/amd64/initrd.gz -- quiet

Caching ubuntu packages

To cache packages used by the installer we use apt-cacher. First install it apt-get install apt-cacher

Then edit /etc/apt-cacher/apt-cacher.conf and add a path_map entry: path_map = ubuntu

The Client Nodes

Boot the client nodes and press F12 when the BIOS screen appears. After this the PXE will start and do the installation on its own without any manual key presses.