This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature: Linux

Getting started with ParallelKnoppix, a live CD for clusters

By Christoper Negus on November 16, 2006 (8:00:00 AM)

Share    Print    Comments   

ParallelKnoppix is a modified Knoppix live CD designed for use in creating HPC clusters. You can start up PK on multiple nodes to run a cluster, and customize PK to add or remove applications.

This article is excerpted from the newly published book Linux Live CDs .

To start PK, power on the computer with the CD in place. At the boot screen, just press Enter, unless you need to pass boot options to the kernel to get it to boot. For example, you might want to pass the acpi=no argument to the kernel if you have had problems getting PK (or other live CDs) to boot.

PK can also be used to run memtest to check the system memory. This is a good idea if you have any problems with the machine that you can't track down, such as programs crashing for no apparent reason.

After ParallelKnoppix has started, you might notice that it seems to be missing the menu bar. Actually, ParallelKnoppix has a taskbar, but it's hidden. Move the mouse to the bottom of the screen, and you'll see the taskbar after it unhides. If this behavior annoys you as much as it does me, right-click the taskbar and select Configure Panel. Then you'll see the Configure KDE Panel dialog, and on the left side you'll see Hiding. Click that and deselect Hide Automatically under Hide Mode.

ParallelKnoppix assumes that you'll be able to pull an IP address via DHCP. If you're not running DHCP on your network, you can open a terminal and use su - to switch to root. ParallelKnoppix has no root password, by default. Then run the following to set up your IP address:

# ifconfig eth0 10.0.0.10 netmask 255.0.0.0 gw 10.0.0.1

Of course, you'll want to change the values to reflect your network setup.

Setting up swap space

If you're booting PK on a Linux machine, it can find and use the swap partition that's already available on the machine. However, if you're using Windows, you won't have a swap file that PK can use, so you'll want to create one. If the system has a FAT filesystem, you can mount that and create a swapfile using dd. For example, to add a swapfile named swapfile.swp to a FAT partition located at /media/hda1, you could type the following:

# dd if=/dev/zero of=/media/hda1/swapfile.swp bs=1024 count=1024k

This will give you a 1GB swapfile; adjust the count to reduce or increase the size of the swap. Note that the general rule of thumb is to have a swap file that's twice the size of system RAM -- at least, that used to be the case before 1GB and more of RAM became common. If you're using swap enough to need more than 1GB of swap, you probably need more RAM than a bigger swapfile. Remember, accessing swap is much, much slower than accessing RAM.

Now you need to format the file as swap and tell the system to use it:

# cd /media/hda1
# mkswap swapfile.swp
# swapon swapfile.swp

That's all there is to it. When remastering the system, you might want to make sure that you set up the swapfile permanently in /etc/fstab. To do this, add a line like this:

/dev/hda1/swapfile.swp  none  swap sw  0 0

Another alternative, if you're going to be using a machine as a cluster node on a regular basis, is to use something like the GParted live CD to reduce the Windows partition a bit and add a swap partition. Because most machines have fairly big drives, users shouldn't miss a 1GB partition for swap, and because PK automatically detects swap, it will make your life that much easier -- and isn't that what computers are all about?

Using applications from the PK live CD

The ParallelKnoppix CD comes with quite a bit of software that isn't necessarily related to clustering. You'll find a number of editors, multimedia applications, Internet applications, games, and a lot more.

Games and whatnot probably won't be on your list of desired apps if you're actually being productive, but if you happen to have the PK disc with you and want to kill some time, you can always turn a boring old Windows machine into a Knoppix desktop for a while.

But PK also comes with a number of useful applications for clustering. On the KDE menu, you'll find a ParallelKnoppix menu that includes a set of scripts for remastering ParallelKnoppix, setting up the cluster, and saving your PK settings.

If PK doesn't include an application you want, such as Firefox, you can add it to the system by remastering PK.

Saving settings

One of the annoying things about a live CD distro is that all your hard work disappears if you reboot the machine -- unless you have a way of saving your settings. PK gives you a way to do this quickly and painlessly.

Go to the ParallelKnoppix menu and look for Save PK Configuration. This dialog walks you through a series of options to save your personal configuration, network settings, and printer settings, then asks where you'd like to save the information. PK is a bit dumb here -- it shows an option to save the configuration to a floppy drive, whether or not one exists. Make sure you verify where you want the file saved to.

Unfortunately, PK doesn't automatically detect the configuration on your hard drive -- you have to specifically tell it to scan the disk for the configuration at boot time, like so:

boot: knoppix myconfig=scan 

Still, that beats reconfiguring PK every time you reboot.

Running ParallelKnoppix in Qemu

If you'd like to try ParallelKnoppix but you don't have two computers to spare, you can run PK under Qemu. If you're using a recent Linux distro, odds are your distro has a Qemu package available. Ubuntu users, for example, can install Qemu by running the following:

# apt-get update
# apt-get install qemu

This installs Qemu and any necessary dependencies. A version of Qemu is available for Windows as well. If you use Windows as your desktop, you can download the Windows installer and give that a shot instead.

To run ParallelKnoppix in Qemu, use this syntax:

# qemu -m mem -cdrom parallelknoppix-2006-06-19.iso

The -m option tells Qemu how much RAM to allocate for the virtual machine. You probably want to allocate at least 384MB of RAM, and more if your machine has enough RAM to spare. (If you're running on a machine with less than 512MB of RAM, running things under Qemu might not make sense.) The -cdrom option tells Qemu to use an ISO image to boot from.

Note that Qemu is not as high performance as VMware Player, Server, or Workstation. You might want to download VMware Server or Player if you want to play with ParallelKnoppix for any amount of time.

© Copyright Pearson Education. All rights reserved.

Share    Print    Comments   

Comments

on Getting started with ParallelKnoppix, a live CD for clusters

Note: Comments are owned by the poster. We are not responsible for their content.

Network booting

Posted by: Anonymous Coward on November 16, 2006 07:00 PM
It is better use network booting on a cluster. Then you don't need to have every machine equipped with a CD-ROM drive, so its much cheaper. When you upgrade the software, you don't have to burn as many CD as you have machines and replace the CD in the machines which can be both expensive and time consuming.

Just use network booting, and the cluster machines don't need either hard disk or CD-ROM drive and everything is easily administrated by only one main computer.

#

Re:Network booting

Posted by: Anonymous Coward on November 18, 2006 04:34 PM
PK boots the compute nodes using PXE. They get their filesystems from the CD in the tray of the main node. Or you can do it all virtually, using the CD image to boot a virtual machine, which is then used to boot real compute nodes.

#

LinuxLiveCD

Posted by: Anonymous Coward on November 16, 2006 10:41 PM
<a href="http://www.linuxlivecd.com/" title="linuxlivecd.com">LinuxLiveCD.com</a linuxlivecd.com>

#

ClusterKnoppix?

Posted by: Anonymous Coward on November 18, 2006 12:28 PM
How does this compare to ClusterKnoppix, which uses the OpenMosix kernel?

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya