Gentoo Linux and OpenMosix

From Clustergroup
Jump to navigationJump to search

Introduction

Many people have found problems with Gentoo's latest oM kernel offerings, in that they are down right unstable to work with. This is due (IMO) to the eBuild's author's usage of later kernels than the oM team have released patches for. The latest official oM release is 2.4.26, and latest eBuild available in Gentoo's Portage is 2.4.28-r5 which is two releases after the latest official oM release. As such, we at OSCG advise that you use the vanilla sources.

HOWTO

This document assumes that you are going to follow through from beginning to end, hence only one 'su' command. If you want to pick up the howto from midway through, please make note of the following conventions:

Conventions Used In This Document

Enter the commands following these symbols as:
$ - a normal user
# - the root user

Linux/oM Kernel

$ su

Enter root password

# rm /usr/src/linux
# emerge =vanilla-sources-2.4.26
# cd /usr/src/linux
# wget http://kent.dl.sourceforge.net/sourceforge/openmosix/openMosix-2.4.26-1.bz2
# bzcat openMosix-2.4.26-1.bz2 | patch -Np1
# make menuconfig

Configure your kernel to your liking, making sure to enable: openMosix->openMosix process migration support.

Exit menuconfig making sure to save the configuration when prompted

# make dep
# make bzImage modules modules_install
# mount /boot
# cp arch/i386/boot/bzImage /boot/kernel-2.4.26-om1
# cp System.map /boot/System.map-2.4.26-om1
# cp .config /boot/config-2.4.26-om1
# nano -w /boot/grub/grub.conf

Amend grub.conf with appropriate lines for your new kernel.

# umount /boot

OpenMosix Tools

# cd /usr/src
# wget http://kent.dl.sourceforge.net/sourceforge/openmosix/openmosix-tools-0.3.6-2.tar.gz
# tar zxf openmosix-tools-0.3.6-2.tar.gz
# cd openmosix-tools-0.3.6-2
# ./configure --with-kerneldir=/usr/src/linux \
  --with-configdir=/etc/openmosix --bindir=/bin \
  --sbindir=/sbin --includedir=/usr/include \
  --mandir=/usr/share/man --libdir=/lib
# make
# make install

Configure

openmosix.map file

# mv /etc/openmosix.map /etc/openmosix.map.orig

openmosix.config file

# nano -w /etc/openmosix/openmosix.config

Uncomment (remove the "#" at the beginning of the line) "MIGRATE=yes" and "BLOCK=no". Comment out (add a "#" at the beginning of the line) "MFS=yes"

Start/Stop openmosix Daemon

For openMosix to be functional upon reboot, we need to enable the daemon that controls everything. We also need to stop the daemon gracefully on a reboot/shutdown.

# echo "/etc/init.d/openmosix start" >> /etc/conf.d/local.start
# echo "/etc/init.d/openmosix stop" >> /etc/conf.d/local.stop

Init

We need to modify the inittab file in /etc to start some processes nodelocked, else we get all kinds of troubles. This means modifying the following lines (Gentoo System):

# nano -w /etc/inittab

Change:

si::sysinit:/sbin/rc sysinit

to:

si::sysinit:/bin/mosrun -h /sbin/rc sysinit

and:

l0:0:wait:/sbin/rc shutdown
l1:S1:wait:/sbin/rc single
l2:2:wait:/sbin/rc nonetwork
l3:3:wait:/sbin/rc default
l4:4:wait:/sbin/rc default
l5:5:wait:/sbin/rc default
l6:6:wait:/sbin/rc reboot
#z6:6:respawn:/sbin/sulogin

to:

l0:0:wait:/bin/mosrun -h /sbin/rc shutdown
l1:S1:wait:/bin/mosrun -h /sbin/rc single
l2:2:wait:/bin/mosrun -h /sbin/rc nonetwork
l3:3:wait:/bin/mosrun -l /sbin/rc default
l4:4:wait:/bin/mosrun -l /sbin/rc default
l5:5:wait:/bin/mosrun -l /sbin/rc default
l6:6:wait:/bin/mosrun -h /sbin/rc reboot
#z6:6:respawn:/bin/mosrun -h /sbin/sulogin

and:

ca:12345:ctrlaltdel:/sbin/shutdown -r now

to:

ca:12345:ctrlaltdel:/bin/mosrun -h /sbin/shutdown -r now

SSH

By default, any processes started from within an SSH session are nodelocked to their parent, and cannot migrate across the cluster. To prevent this from happening, and enable migration of processes started from within an SSH session, we need to add a line to the /etc/profile file.

echo "echo 0 > /proc/self/lock" >> /etc/profile

Reboot

# reboot

Upon receiving the grub selection screen, select the new openMosix kernel and press [enter] (unless you specified in the grub.conf that it should be the default, in which case just let the boot process continue uninterrupted).

Conclusion

You now have a working Gentoo GNU Linux/openMosix node. Repeat these steps for all the nodes that you wish to join the cluster, making sure that they are all connected directly to the same network (usually means connect them all to the same switch/hub). Boot up two or more machines at the same time, and bask in openMosix goodness.

See Also : OpenMosix Config Files