16
PC Cluster Setup on Linux Fedora Core 5 High Performance Computing Lab Department of Computer Science and Information Engineering Tunghai University, Taichung, Taiw an 40704, ROC Presenter: Hao-Yu Tung

PC Cluster Setup on Linux Fedora Core 5 High Performance Computing Lab Department of Computer Science and Information Engineering Tunghai University, Taichung,

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

PC Cluster Setup on Linux Fedora Core 5

High Performance Computing LabDepartment of Computer Science and Infor

mation EngineeringTunghai University, Taichung, Taiwan 40704,

ROCPresenter: Hao-Yu Tung

HPC Lab., CSIE@Tunghai University

Contents Install Linux OS Set up Network Information System (NIS) Set up Network File System (NFS) Set up Secure Shell (SSH) Set up Message Passing Interface (MPI)

HPC Lab., CSIE@Tunghai University

Install Linux OS Install Fedora Core 5 Linux distribution

Install from CD-ROM Install from network (create a boot disk) Full install or custom if you are an expert Set separate IP for each machine (e.g. 192.168.1.1,

192.168.1.2)Com3

eth0: 192.168.1.1

eth1: 140.128.101.xxx

eth0: 192.168.1.2

HPC Lab., CSIE@Tunghai University

Install Linux OS (cont.) Partition

Consider you have a hard driver with 30GB in size Full installation of Fedora Core 5 will using 5GB available di

sk space Server side:

/ 10GB, holding root file system and RPM packages

Swap 256MB, as large as your physical memory /home the rest size of the disk , for NFS home usage

Client side: Swap 256MB, as large as your physical memory / the rest size of the disk

Disable the firewall and reboot #chkconfig --level 345 iptables off #chkconfig --level 345 ip6tables off (optional)

HPC Lab., CSIE@Tunghai University

Install Linux OS (cont.) After installation, you will use “adduser” a

nd “passwd” to add a normal user on server #adduser [test] #passwd [test]

Editing your “/etc/hosts” file # vi /etc/hosts

Here should be your server and client private ip and hostname

HPC Lab., CSIE@Tunghai University

Set up NIS (Server side) Install NIS server

#wget http://ftp.isu.edu.tw/pub/Linux/Fedora/linux/core/5/i386/os/Fedora/RPMS/ypserv-2.19-0.i386.rpm

#rpm –ivh ypserv-2.19-0.i386.rpm Setting up NIS domain name on file “/etc/rc.

d/rc.local" #nisdomainname cluster #vi /etc/rc.d/rc.local

Temporary (Disappears after

reboot)

Add this line

HPC Lab., CSIE@Tunghai University

Set up NIS (Server side) Enabling ypserv and yppasswdd service

#service ypserv restart #service yppasswdd restart #chkconfig –level 345 ypserv on #chkconfig –level 345 yppasswdd on

Makefile #cd /var/yp #make

You’ll see this after

using the command “make”

HPC Lab., CSIE@Tunghai University

Set up NIS (Client side) Install NIS client

#wget http://ftp.isu.edu.tw/pub/Linux/Fedora/linux/core/5/i386/os/Fedora/RPMS/ypbind-1.19-0.i386.rpm

#rpm –ivh ypbind-1.19-0.i386.rpm Setting up NIS domain name on file “/etc/rc.

d/rc.local" #nisdomainname cluster #vi /etc/rc.d/rc.local

Temporary (Disappears after

reboot)

Add this line

HPC Lab., CSIE@Tunghai University

Set up NIS (Client side) Enabling ypbind service

#service ypbind restart #chkconfig –level 345 ypbind on

Editing “/etc/nsswitch” file # vi /etc/nsswitch.conf

Original file

HPC Lab., CSIE@Tunghai University

Set up NIS (Client side)

Enabling ypbind service #service ypbind restart

#chkconfig –level 345 ypbind on

Change to this

HPC Lab., CSIE@Tunghai University

Set up NIS (Client side) For testing NIS on client

#yptest

HPC Lab., CSIE@Tunghai University

Set up NFS (Server side) Server Side

Create file “/etc/exports” to configure NFS in /etc directory by root privilege

/home 192.168.1.0/255.255.255.0(rw,no_root_squash) /usr/local 192.168.1.0/255.255.255.0(rw,no_root_squash)

Enable the NFS daemon #chkconfig --level 345 nfs on #service nfs restart

No blank space within

this line

HPC Lab., CSIE@Tunghai University

Set up NFS (Client side) Client Sides

Testing configuration (Optional) #mount –t nfs server:/home /home #mount –t nfs server:/usr/local /usr/local

Edit file “/etc/fstab” by adding the following two lines

server:/home /home nfs defaults 0 0 server:/usr/local /usr/local nfs defaults 0 0

Move original home to home2 and create a new home

#mv home home2 #mkdir home

Re-mount file system or reboot #mount –a

HPC Lab., CSIE@Tunghai University

Set up SSH Enable SSH server

#chkconfig --level 345 sshd on #service sshd restart

If you want to use ssh without password by the following steps in your account $ssh-keygen -t rsa

$cd /home/[user]/.ssh/ $cp id_rsa.pub authorized_keys2 $ssh [client_machine]

HPC Lab., CSIE@Tunghai University

Setup MPI Install MPI on server and client respectively by using root account

#wget http://ftp.isu.edu.tw/pub/Linux/Fedora/linux/core/5/i386/os/Fedora/RPMS/libaio-0.3.106-2.2.i386.rpm

#rpm –ivh libaio-0.3.106-2.2.i386.rpm #wget http://ftp.isu.edu.tw/pub/Linux/Fedora/linux/core/5/i386/os/Fedor

a/RPMS/libaio-devel-0.3.106-2.2.i386.rpm #rpm –ivh libaio-devel-0.3.106-2.2.i386.rpm #wget http://ftp.isu.edu.tw/pub/Linux/Fedora/linux/core/5/i386/os/Fedor

a/RPMS/lam-7.1.1-11.i386.rpm #rpm –ivh lam-7.1.1-11.i386.rpm

Use MPI (cannot use root account) Create file “lamhost”

$recon –v lamhost $lamboot –v lamhost $wipe –v lamhost

HPC Lab., CSIE@Tunghai University

Setup MPI (cont.) Complie MPI C program

$mpicc –o file file.c Execute MPI C program

$mpirun –np <process number> file