2010/7/22

PC-clusters on Fedora 13 by using MPICH2

Recently, Due to some reason, I have to wake up my memory on setting pc-clusters on redhat long time age and then doing it again on Fedora 13.

PC-cluster:
NFS + NIS + (SSH or RSH) + intel compiler + MPICH2

1. update your system
* Set up your network to make it work well
* yum update OR yum upgrade
* Shut down the firewall and SELinux
=>System => Administration => Firewall=> disable
=>System => Administration => SELinux management => disable
=> vim /etc/selinux/config => SELINUX=disabled
=> vim /boot/grub/menu.lst => add "selinux=0" in back of kernel
* Shut down the service you do not need because we don't have firewall
=> sendmail, iptables, ip6tables, httpd, cup and etc.

2. hosts
* The inner computer must can be checked each others
=> 192.168.10.1 n1
=> 192.168.10.2 n2
=> 127.0.0.1 n1 localhost
* This is very important step. If you have the message as using mpd later like that
=> conn error in connect_rhs: Connection refused
(connect_rhs 979): failed to connect to rhs at 127.0.0.1 48503
(enter_ring 886): rhs connect failed
failed to enter ring
* This due to the n2 always connect to itself as checking the hosts file
* You have to change the localhost to the last line, and put 192.168.10.2 n2 in first line

3. NFS
rpm: nfs , nfs-utils, rpcbind (before fedora 7 is portmap)
on n1
* I want to share the /home and /opt to n2
* vim /etc/exports
=> /home 192.168.10.0/24(rw,async,no_root_squash)
=> /opt 192.168.10.0/24(ro,async)
* restart the nfs and rpcbind
* observe whether it work
=> check /var/log/messages
=> showmount -e n1
=> netstat -utln
=> rpcinfo -p n1
On n2
* restart rpcbind
* Can it find the n1 share
=> showmount -e n1
* Mount n1 share to n2
=> mount -t nfs n1:/home /home
=> mount -t nfs n1:/opt /opt
* edit the /etc/fstab
=> n1:/home /home nfs defaults 1 2
=> n1:/opt /opt nfs async,auto,ro,exec,nouser

4. NIS
rpm: yp-tools,ypbind,ypserv,rpcbind
on n1 (NIS server):
**set nis domainname
=>nisdomainname aaa
=>vim /etc/rc.d/rc.local
=>/bin/nisdomainname aaa
=> add "NISDOMAIN=vbirdnis" in /etc/sysconfig/network
**edit main configure file
=>vim /etc/ypserv.conf
127.0.0.0/255.255.255.0 : * : * : none
192.168.10.0/255.255.255.0 : * : * : none
* : * : * : deny

**edit the trust group
=>touch /etc/netgroup
**restart the service: rpcbind, ypserv, yppasswdd
**set the user and password to database for ypserver
=>/usr/lib/yp/ypinit -m
***If the error message says miss some file, just touch it
=>touch /etc/aliases
=>/usr/lib/yp/ypinit -m
**restart the service: rpcbind, ypserv, yppasswdd

on n2 (NIS client):
rpm: ypbind, yp-tools
**set nis domainname as same as n1 server
=>nisdomainname aaa
=>vim /etc/rc.d/rc.local
=>/bin/nisdomainname aaa
=> add "NISDOMAIN=vbirdnis" in /etc/sysconfig/network

**change user and password in authentication
=>vim /etc/nsswitch.conf
passwd: files nis
shadow: files nis
group: files nis
hosts: files nis dns

**edit authconfig
=>vi /etc/sysconfig/authconfig
USENIS=yes <- change no to yes

**edit pam
=>vi /etc/pam.d/system-auth
"password sufficient /lib/security/$ISA/pam_unix.so nullok use_authtok md5 shadow"
change to
"password sufficient /lib/security/$ISA/pam_unix.so nullok use_authtok md5 shadow nis"

**set which server to look up
=>vi /etc/yp.conf
domain aaa
server n1

**restart ypbind and rpcbind

**test
=>yptest

5. SSH
rpm: sshd
server: n2
client: n1
**Actually, n1 and n2 always turn on ssh server as the operating system installing

**restart sshd

**no password log in n2 (MPICH2 user-manual suggest)
on n1 (client):
=>ssh-keygen -t rsa
=>cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys

on n2 (server):
**switch on sshd to RSA Authentication
=>vim /etc/ssh/sshd_config
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

**restart sshd


6. intel compiler

7.MPICH




To be continued