Diskless cluster on debian

2011 Apr 01

This is all that is needed to make a diskless cluster on debian.

Any client that connects to eth0 becomes a node.

Server info:

uname -rv
2.6.26-2-amd64 #1 SMP Thu Nov 25 04:30:55 UTC 2010
cat /etc/debian_version
5.0.7

network

<{{static/src/diskless-cluster-on-debian-installation-log/etc-network-interfaces}}

<{{static/src/diskless-cluster-on-debian-installation-log/etc-hosts}}

packages

sudo apt-get install dhcp3-server syslinux\
             nfs-kernel-server nfs-common debootstrap tftpd-hpa

DHCP

<{{static/src/diskless-cluster-on-debian-installation-log/etc-dhcp3-dhcpd.conf}}

tftpd

<{{static/src/diskless-cluster-on-debian-installation-log/etc-inetd.conf}}

PXE

sudo cp -r /usr/lib/syslinux/pxelinux.0 /var/lib/tftpboot/ sudo mkdir /var/lib/tftpboot/pxelinux.cfg sudo cp /boot/vmlinuz-uname -r /var/lib/tftpboot/ sudo cp -r /etc/initramfs-tools /etc/initramfs-pxe


* Edit `/etc/initramfs-pxe/initramfs.conf`, change `BOOT=local` to `BOOT=nfs`.

* ``` shell
sudo mkinitramfs -d /etc/initramfs-pxe\
            -o /var/lib/tftpboot/initrd.img-`uname -r` `uname -r`

<{{static/src/diskless-cluster-on-debian-installation-log/var-lib-tftpboot-pxelinux.cfg-default}}

NFS

sudo mkdir /home/nfsroot


* /etc/exports

/home/nfsroot 192.168.1.0/255.255.255.0(rw,no_subtree_check,async,no_root_squash)


* ``` shell
debootstrap --arch amd64 squeeze /home/nfsroot/

<{{static/src/diskless-cluster-on-debian-installation-log/home-nfsroot-etc-fstab}}

<{{static/src/diskless-cluster-on-debian-installation-log/home-nfsroot-etc-network-interfaces}}

Misc

To change something on a node:

chroot /home/nfsroot then (adduser …) (passwd …) (apt-get …)