Building a Beowulf Cluster in Ubuntu 12.04 LTS

To build a Beowulf cluster, we set up a system as Master node and others as slave nodes.

And by others, I mean we need at least two or more systems to build a cluster.

(Remember that we are making one of them as Master node and rest slaves)

Follow the steps given below in Ubuntu terminal

Add the hosts to the node files.

–  To know the hosts, Type ifconfig in terminal n see the ip address (i.e your host address)

Do the same on slave system and note the ip address host file for all the nodes( master and slave ) as

sudo gedit /etc/hosts      localhost    master    node1    node2    node3

Make  sure it doesn’t look like this:      localhost      master    node1    node2    node3

Save the host file after editing

Once saved ,you can use the host name to connect to the other nodes


-ping master (type this command on slave node)


-ping node1 (this on master node)

You should get a response similar to this:

PING master ( 56(84) bytes of data.
64 bytes from master ( icmp_req=1 ttl=64 time=0.606 ms
64 bytes from master ( icmp_req=2 ttl=64 time=0.552 ms
64 bytes from master ( icmp_req=3 ttl=64 time=0.549 ms

Defining a user for running MPI jobs

Enter the below command:

sudo adduser mpiuser --uid 999

You can give any name instead of mpiuser and a user id below 100, but make sure that the name and id is the same on all nodes.

This will create a folder name mpiuser in your home folder.

Now we need to set up Network File System (NFS) in order to access files among master and slave nodes

Enter following command on master node :

master:~$ sudo apt-get install nfs-kernel-server

And in order to make it possible to mount a Network File System on the compute nodes, the nfs-common package needs to be installed on all slave  nodes:

$ sudo apt-get install nfs-common

We will use NFS to share the MPI user’s home directory (i.e. /home/mpiuser) with the compute nodes.

Enter these commands on master node:

master:~$ ls -l /home/ | grep mpiuser
master:~$ sudo chown mpiuser:mpiuser /path/to/shared/dir

To share the directory of master node with all other slave nodes ,we need to edit /etc/ exports file on master node by adding the following line to it:

/home/mpiuser *(rw,sync,no_subtree_check)

After the first install you may need to restart the NFS daemon on master node:

master:~$ sudo service nfs-kernel-server restart

The /home/mpiuser directory should now be shared through NFS. In order to test this, you can run the following command from a compute node:

showmount -e master

Now, Reboot the compute nodes and list the contents of the /home/mpiuser directory on each compute node to check if you have access to the data on the master node.

ls /home/mpiuser

This should lists the files from the /home/mpiuser directory of the master node. If it doesn’t immediately, wait a few seconds and try again. It might take some time for the system to initialize the connection with the master node.


  2.  Kerry D. Wong. A Simple Beowulf Cluster.
  3. Building a Beowulf Cluster in just 13 steps.

One comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s