Clustering manual


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Clustering manual

  1. 1. CLUSTERING MANUALIntroduction:Parallel computing is a form of computation in which many calculationsare carried out simultaneously operating on the principle that largeproblems can often be divided into smaller ones, which are then solvedconcurrently ("in parallel")What Is Cluster:In a computer system, a cluster is a group of servers and other resourcesthat act like a single system and enable high availability and, in somecases, load balancing and parallel processingBeowulf Cluster: Beowulf is an approach to building a supercomputer as a cluster ofcommodity off-the-shelf personal computers, interconnected with a localarea network technology like Ethernet, and running programs written forparallel processing.Cluster Prerequisites:1. Atleast Two Computers with a Linux Distribution installed in it.Makesure that your system has GCC installed in it.2. A network connection between them. If you have just two computers,you can connect them using an ethernet wire. Make sure that IPaddresses are assigned to them. If you don’t have a router to assign IP,you can statically assign them IP addresses, assign static IP addresses.
  2. 2. Steps Of Building a Beowulf Cluster:The following steps are to be done for every node.Step 1:Add Nodes-First add the nodes.We can add the nodes in /etc/hosts file.We can usethe text editor to add nodes IP address followed by its host name. Forexample, node0 node1 will list the nodes using their host names. When required, theprogram will use this hosts file to convert host names to correspondingI.Ps.Like 10.255.2.x hostname1 10.255.2.y hostname2 10.255.2.z hostname3Step 2:Create a user-We shpuld create a new user for all nodes.we can create new userthrough System->Administration->Users and Groups and give apassward.We need to make same user all nodes not need to make samepassward to all nodes.Step 3: Installing SSH-Now download and install ssh-server in every node. Execute thecommand sudo apt-get install opensshserver. Now we need to useOpenSSH Server for enabling remote login. It should be mentioned thatremote tasks can be performed through telnet as well. But it does not
  3. 3. provide security for data flow. OpenSSH is a safer method for remotelogin between PCs, hence it is adopted.Step 4:Login to new user-Now logout my current sesson and login as mpiuser.Step 5: Generating SSH key-After login as mpiuser open the terminal and type the ssh-keygen -t dsa.This command will generate a new ssh key. It will be saved in the fileid_dsa and The public key is saved in the file~/.ssh/, while ~/.ssh/id_dsa is the private key. These files willbe saved in /home/mpiuser/.ssh/.Step 6: Authorizing Keys-A folder called .ssh will be created in your home directory. Its a hiddenfolder. This folder will contain a file that contains yourpublic key. Now copy this key to another file called authorized_keys inthe same directory. Execute the command in the terminal cd/home/mpiuser/.ssh; cat >>authorized_keys.If we donot dothis then we need to passward for every time for connect to otherscomputer.Step 7:Download MPICH1-Now download the MPICH1 from the web. Parallel computing systemMPICH is a robust and flexible implementation of the MPI (MessagePassing Interface). MPI is often used with parallel or distributedcomputing projects. MPICH is a multi-platform, configurable system(development, execution, libraries, etc) for MPI. It can achieve
  4. 4. parallelism using networked machines or using multitasking on a singlemachine.Step 8:Install MPICH1-Make a folder in home folder then configure it and install it by executingthe command :mkdir /home/mpiuser/mpich1./configure --prefix=/home/mpiuser/mpich1makemake installStep 9:Editing files-Open the file .bashrc in your home directory. If file does not exist, createone. Copy the following code into that fileexport PATH=/home/mpiuser/mpich1/bin:$PATHexport PATHLD_LIBRARY_PATH="/home/mpiuser/mpich1/lib:$LD_LIBRARY_PATH"export LD_LIBRARY_PATHThe two lines are used to append the address /home/mpiuser/mpich1/binwhich contains necessary executables of MPICH to the PATH variable.The last two lines are used to append the address/home/mpiuser/mpich1/lib which contains necessary libraries of MPICHto the shared library path.Step 10:Define the path to MPICH for SSH-
  5. 5. Give this command to add the bin directory of mpich1 to environment:sudo echo /home/mpiuser/mpich1/bin >> /etc/environmentNow logout and login back into the user mpiuser.Step 11:Edit machines.Linux- In the folder mpich1, within the sub-directory share or util/machines/ afile called machines.LINUX will be found. Open that file and add thehostnames of all nodes except the home node ie. If youre editing themachines.LINUX file of node0, then that file will contain host names ofall nodes except node0. By default MPICH executes a copy of theprogram in the home node. The machines. sample contents ofmachines.LINUX file: hostname1 hostname2Now cluster is ready .We can run any program through cluster.