How To Build a Linux Cluster

A cluster is essentially a group of individual computers that have been linked together to practically perform as one computer whose augmented processing power is far greater than an individual unit. A computer belonging to a cluster is referred to as a node and is a complete and functional system by itself. A Linux cluster specifically uses computers that are running on the Linux operating system.

  1. Network at least 2 Linux-based computers. It's important that their connection is good. Ping one machine from the other by name to test this. Also input the appropriate settings in your firewall to allow communication between the two computers.
  2. Install GNU C and GNU FORTRAN compilers.
  3. Configure the SSH. SSH or secure shell is a network protocol that allows for secure data exchange by using encryption. The objective is to modify its settings in such a way that commands can be run on the two nodes without the need for authentication. To create a private and public key file use the following command: ssh-keygen -f /tmp/key -t dsa. Copy the private key file into /root/.ssh/identity and the public key file into /root/.ssh/authorized_keys. Do this for all computers in the cluster.
  4. Utilize an open source message passing interface. MPI or message passing interface is one of several existing programming interfaces typically used for setting up clusters that will need to do a lot of heavy duty computing. It has services for carrying data across a network and other tools such as those for starting and stopping applications. MPICH is the open source implementation. There are several versions, so be sure to get one for UNIX. To configure MPICH to use SSH as its network protocol use this command: ./configure -rsh=ssh
  5. Set MPICH to recognize all the computers in your cluster. Go to the file: /tmp/mpich-1.2.6/util/machines/machines.LINUX and add the hostnames of each computer in your cluster. The whole directory: /tmp/mpich-1.2.6 should then be copied into every computer in the cluster. This step is fairly easy since you're only starting with a two-node cluster. But in case you add more computers, remember to repeat this step.
  6. Execute test programs. The cd /tmp/mpich-1.2.6/utils/examples directory will contain sample programs you can execute to test the stability or readiness of your cluster. If nothing goes amiss then your Linux cluster is ready to go.

Based on how nodes in a cluster are structured, there are actually various types of clusters. The simplest is the fail-over cluster where some nodes are active and others are on stand-by monitoring the active nodes. When the active nodes fail, those on stand-by replace them. Another type is called the load balancing cluster, and this is commonly used for handling large, busy websites. Each node is set to host the site, and requests are routed to whichever node is doing the least work. Finally there is the high performance cluster, and this is needed for situations where a huge amount of work needs to be accomplished through intensive computation.


Share this article!

Follow us!

Find more helpful articles: