Professional Documents
Culture Documents
Home My Accounts | Newsletter | News Flash | Contact Us | Search
This document outlines the process required to install and configure Linux for
use in a cluster environment. While no prior knowledge of either Linux or
clusters is assumed, the reader should be forewarned that this is not a trivial
task.
What is Linux?
What is a Cluster?
The First Step: Hardware Considerations
Clusters in an Ideal World
The Master Node
Processor Speed
Disk Speed
Network Speed
RAM
The Slave Nodes
Processor Speed
Network Speed
RAM
Other Hardware Components
The Second Step: Installing Linux
Gather Hardware Information
Monitor
Video Card
Hard Drive
Network Card
Install Linux
The Third Step: Configuring the Nodes
General Linux System Files
/etc/hosts
/etc/hosts.equiv
.rhosts
/etc/securetty
/etc/pam.d
/etc/exports
1 of 14 07/12/2010 12:27 PM
How to Build a Linux Bewoulf Cluster http://www.mcsr.olemiss.edu/bookshelf/articles/ho...
/etc/fstab
Enabling Required Services
Testing the Configuration
Adding a User
General Notes
What is GNU/Linux?
Back to Top
What is a Cluster?
2 of 14 07/12/2010 12:27 PM
How to Build a Linux Bewoulf Cluster http://www.mcsr.olemiss.edu/bookshelf/articles/ho...
computing.
Back to Top
To build a cluster, one must have access to computers on which to install the
software. Therefore, it makes sense to cover this early in the process.
There are four main considerations when building the master node. They
are: processor speed, disk speed, network speed, and RAM.
Processor Speed
3 of 14 07/12/2010 12:27 PM
How to Build a Linux Bewoulf Cluster http://www.mcsr.olemiss.edu/bookshelf/articles/ho...
Disk Speed
Network Speed
RAM
RAM is crucial in the master node for two reasons. First, the
more RAM, the more processes can be run without accessing the
disk. Second, the Linux kernel can and will cache its disk
writes to memory and keep them there until they must be written
to disk. Both of these increase the speed of the master node
which is critical to good overall cluster performance.
Slave Nodes
The slave nodes need to accomplish two tasks: perform the computations
assigned to them and then send that data back out over the network. For
this reason, their disk performance is not critical. In fact, it
is common to have nodes without hard drives in a cluster. These diskless
4 of 14 07/12/2010 12:27 PM
How to Build a Linux Bewoulf Cluster http://www.mcsr.olemiss.edu/bookshelf/articles/ho...
nodes further reduce the cost of building a cluster and eliminate some
of the time required to set a cluster up. This document, however,
assumes that the slave nodes will have hard drives.
The three most important hardware considerations for slave nodes are
processor speed, network speed and RAM.
Processor Speed
Network Speed
This affects the slave nodes in exactly the same way that
it does the master node. See that section above
for more information.
RAM
This affects the slave nodes in exactly the same way that it
does the master node. See that section above for more
information.
5 of 14 07/12/2010 12:27 PM
How to Build a Linux Bewoulf Cluster http://www.mcsr.olemiss.edu/bookshelf/articles/ho...
nodes can produce a significant amount of heat and effect both the
stability of the cluster and comfort of the operator. This is especially
important when using AMD based machines in a small room.
Back to Top
After the machines are assembled, the next logical step is to install Linux.
There are many distributions of Linux available and different people prefer
different distributions for different reasons. This document uses RedHat 7.1
with the default kernel as a basis. Other versions of Linux can be used,
however, and some are more or less desirable depending on the experience
level
of the cluster administrator or personal taste.
Monitor
Video Card
Hard Drive
6 of 14 07/12/2010 12:27 PM
How to Build a Linux Bewoulf Cluster http://www.mcsr.olemiss.edu/bookshelf/articles/ho...
Be sure the know the size of the drive as this will effect how
the partitions are set up later in the install process. Note
that some ATA100 drives or controllers may be problematic when
using the 2.4.2 kernel that comes with RedHat 7.1
Network Card
Know the make and model of the card. It is very likely that the
installer will detect this properly but there is always a chance
that configuration will have to be done manually.
Install Linux
Linux will need to be installed on every node of the cluster. Thanks to the easy
to use installers that ship with most Linux distributions, this task is becoming
trivial. Nevertheless, you may want to refer to these Red Hat guides:
The Official RedHat Linux x86 Installation Guide
The Official Red Hat Linux Reference Guide
Red Hat's Official Linux Reference Guide: Appendix B--Introduction to Disk
Partitions
7 of 14 07/12/2010 12:27 PM
How to Build a Linux Bewoulf Cluster http://www.mcsr.olemiss.edu/bookshelf/articles/ho...
For the slave nodes, you just the / partition and the swap partition, since
the applications will all be installed on the master node's /usr/local
partition, and since all user files will be stored on the master nodes /home
partition. The /home and /usr/local of the slave nodes are mounted to
those on the master node, so they can be any size on the slave node. If you
type "cd /home or cd /usr/local" on the slave node, you are actually going
to the directory on the master node thanks to NFS (Network File System).
6. Since it is assumed that Linux will be the only operating system on the
master node and the slave nodes, install LILO, the Linux bootloader, to
the MBR(Master Boot Record) of the primary hard disk.
7. Now choose the packages to install. At the minimum, make sure that NFS,
Networked File System, and RSH, Remote Shell, are installed. It is also a
good idea to install SSH as a backup in case RSH fails but this is not
required. One way to ensure that these packages get installed is to simply
choose everything. This is not a bad idea if disk space is not a concern, as
you can always turn off unneeded services later. Otherwise, you must
check the "Select Individual Packages" box on the "Package Group
Selection" page.
8. RedHat will now ask about installing and configuring their firewall. If the
cluster has no contact with the outside world or is behind a very good
firewall, it is advisable to not install the firewall at all. If the firewall is
installed, make sure that it allows connections via SSH and RSH.
9. We need to add a step here about configuring X.
10. Once the packages have installed, the user is presented with an option to
make a boot disk. Making a boot disk is always a very good idea.
11. One of the last steps in installing Linux is deciding whether or not the
computer should boot up into graphical mode. Setting the default run
level to 5, graphical mode, can cause some problems if it has not been
fully tested. Generally, it is a better choice to have the system's default
run level set for 3, multi-user with networking, until it is certain that the
8 of 14 07/12/2010 12:27 PM
How to Build a Linux Bewoulf Cluster http://www.mcsr.olemiss.edu/bookshelf/articles/ho...
X window system will not cause any problems. Once it has been
determined that the system functions properly in run level 5, it is possible
to set the computer to boot into graphical mode by editing /etc/inittab and
changing the line that looks like:
id:3:initdefault:
to
id:5:initdefault:
12. Now Linux is installed. Reboot the computer and continue to the next
step.
Back to Top
The clustering software must be installed on the master and nodes, of course.
This can be done now, or later. For mimosa, we used the Portland Group's
Cluster Development Kit. This step is not covered in detail in this document.
Be sure to read the documentation for the clustering software to be used as
different software may require some different configuration procedures.
Type "setup" and make sure that rsh, rlogin, and rexec are checked. Also make
sure that NFS is running.
You will need to decide what to IP addresses to use for the nodes of your
cluster. For what it's worth, Spector recommends using a Net 10 special
address class--that is, giving each node an address of 10.X.X.X, such as:
10.0.2.1, 10.0.2.2, 10.0.2.3, etc. However, for mimosa, we elected to use:
192.168.0.1, 192.168.0.2, 192.168.0.3, etc. You might try the same.
/etc/hosts
Edit this file on every cluster node, adding the names and IP addresses of
every node in the cluster. This allows these machines to be accessed by name
9 of 14 07/12/2010 12:27 PM
How to Build a Linux Bewoulf Cluster http://www.mcsr.olemiss.edu/bookshelf/articles/ho...
instead of by IP number. A typical /etc/hosts file will look something like this,
where mimosa is the hostname of the master node and the others are the
hostnames of the slave nodes except localhost:
127.0.0.1 localhost
192.168.0.1 mimosa
192.168.0.2 node1-1
192.168.0.3 node1-2
192.168.0.4 node1-3
192.168.0.5 node1-4
192.168.0.6 node1-5
192.168.0.7 node1-6
192.168.0.8 node1-7
192.168.0.9 node1-8
/etc/hosts.equiv
192.168.0.1 mimosa
192.168.0.2 node1-1
192.168.0.3 node1-2
192.168.0.4 node1-3
192.168.0.5 node1-4
192.168.0.6 node1-5
192.168.0.6 node1-6
192.168.0.8 node1-7
192.168.0.9 node1-8
.rhosts
This file should exist in each user's home directory. Notice the
"." at the beginning of the file name. This means that this file
will be hidden. This file is also required so users can use RSH
to connect to each node without supplying a password.
10 of 14 07/12/2010 12:27 PM
How to Build a Linux Bewoulf Cluster http://www.mcsr.olemiss.edu/bookshelf/articles/ho...
mimosa
node1-1
node1-2
node1-3
node1-4
node1-5
node1-6
node1-7
node1-8
/etc/securetty
This file is a list of tty's from which root can log in. This
allows for easier administration of the nodes and is highly
recommended. Simply add "rsh", "rexec", and "rlogin" to the end
of the file.
/etc/pam.d
Modify the rsh, rlogin, and rexec files by rearranging the lines
to have the line with "rhosts" as the first line and the line
with "securetty" as the second line. An example of these files
after modification is given below:
/etc/exports
11 of 14 07/12/2010 12:27 PM
How to Build a Linux Bewoulf Cluster http://www.mcsr.olemiss.edu/bookshelf/articles/ho...
/home 192.168.0.0/255.255.255.0(rw,no_root_squash)
/usr/local 192.168.0.0/255.255.255.0(rw,no_root_squash)
/etc/fstab
The following lines should be added to mount the two exports set
up above.
On each node, type ifconfig and make sure that the machine has its
appropriate interior IP address. (Such as 192.168.0.X).
On each node, go to /etc/rc.d/init.d/ and type ../network stop. On the master
node, also type ../nfs stop
On the master node, type ../nfs start
On each node, type ../network start.
Now that the required modifications have been made, enable rsh, rlogin
and rexec on all nodes. There are several ways to do this. On RedHat, as
root enter the command "setup". Choose "System Services" then select
each of the items listed above. When configuring the master node be sure
to select "nfs" as well. Select items by pressing the space bar.
2. Ensure that rsh will work without a password by trying, from the
12 of 14 07/12/2010 12:27 PM
How to Build a Linux Bewoulf Cluster http://www.mcsr.olemiss.edu/bookshelf/articles/ho...
Add a User
To create a user log onto the master node. The easiest way is to use X windows.
Find linuxconf under programs, system. Go to user accounts and add your
user. To clone this user to the slave nodes use these commands
Make sure you notice the (.). That means to copy this file to the current
directory. If you have some problems with rcp, you may have to type the full
path (/usr/bin/rcp followed by the rest of the command). The passwd and
shadow files contain the information about all the users accounts on that
particular machine.
Back to Top
General Notes
The most glaring issue with this process is the security implications it raises.
Allowing root to log in remotely to a node via rsh is not generally
recommended
in a general purpose Linux installation. Using /etc/hosts.equiv and the other
methods to allow logins without supplying a password is usually frowned on as
well. In fact, rsh and rlogin are considered insecure themselves. For these
reasons, it is absolutely imperative that, if the master node can be
accessed from the Internet, great care is taken to ensure the security of the
cluster.
Remember that when a user is added to the system, it will necessary to add
that
user to all nodes. This is most easily accomplished by simply copying
/etc/passwd and /etc/shadow from the master node to all other nodes.
hostname host1
13 of 14 07/12/2010 12:27 PM
How to Build a Linux Bewoulf Cluster http://www.mcsr.olemiss.edu/bookshelf/articles/ho...
Back to Top
14 of 14 07/12/2010 12:27 PM