SuperComputing 2001, Denver, Colorado

 
Lab #2:   How to Build a PC cluster


Table of Contents
 
  1. Purpose
  2. Server Setup
  3. Client Setup
    1. Network Check
    2. NFS for client
    3. NIS for client
    4. Printer Configuration for client (Optional)
  4. References
  5. Acknowledgments


1. Purpose


Note: We assume that you have installed RedHat Linux 7.1 on your computer. If not, please follow the instructions described in Lab #1.

Reboot your computer in Linux mode.

2. Server Setup

For the server setup login as root.

2.1 Checking the Network

  1. First we will check if the previous network setup during the installation process was successful. For that we will use the ifconfig command.

$> ifconfig

  1. Make sure both ethernet cards are set up right, with the right hardware addresses connecting to the right IP  numbers. Try to ping yourself, the gateway, the outside world and each of the clients:

$> ping galaxy26

$> ping <XXX.XXX.XXX.XXX> (IP address of the gateway)

$> ping duncan.cs.utk.edu   (Computer somewhere outside)

$> ping 192.168.1.1 (for star1)

  1. Now we need to create a list of our favorite hosts. You need to edit the file /etc/hosts, and enter the IP addresses, names and nicks. This will look as following:

192.168.1.1                   star1            star1

192.168.1.100              galaxy26    galaxy26 (IP address for your local network)

XXX.XXX.XXX.XXX    galaxy26    galaxy26.XXX.XXX.XXX (use IP address for global network)

  1. Now ping each of the client hosts by using its nick:

$> ping star1

  1. Next we set up the daemons, so they automatically start at boot-up.

Note: Later on we will disable the rsh daemon on the server for security reasons! 

  1. For the next lab we will need rsh, so lets set it up manually:

$> cd /etc/xinetd.d

$> /etc/rc.d/init.d/xinetd restart

$> rsh galaxy26

Interrupt rush by pressing Ctrl-D (it may be necessary to press it repeatedly)

 

2.2 NFS server

Next we will set up the NFS (Network File System). This means that it can export filesystems to other systems, and mount filesystems from other machines. We already activated the daemons on reboot in the Setup --> System Services.
  1. Edit the /etc/exports file to specify the filesystems (to be shared), hosts (to be allowed) and the type of permissions (ro, rw). You need to have the following entries in this file:
/home  {client_machine}(rw)

/usr/export    {client_machine}(rw)

  1. Create the directory /usr/export

$> mkdir /usr/export

  1. Tell the NFS daemons to examine this file for new information:
$> /usr/sbin/exportfs -a
  1. Reboot the computer

$> shutdown -r now

  1. Login again as root, then check if NFS works:

$> rpcinfo -p

Check for the presence of mountd and nfs daemons.

Note: NEVER try to mount  the /etc directory unless you are experienced. It is very likely to crash all your settings. And the solution will be to start all over again from the Linux installation.

2.3 NIS server

Now we will enable the NIS (Network Information System): 

    1. Set up the NIS domain by running:

$> domainname workshop

    1. Edit /etc/sysconfig/network to add a domain name, e.g. workshop, by adding:

NISDOMAIN=workshop

    1. Edit the /etc/yp.conf file by specifying the NIS server (galaxy26):

ypserver galaxy26
domain workshop

    1. Start up the ypserv daemon from /etc/rc.d/init.d:
$> /etc/rc.d/init.d/ypserv restart
    1. Edit the /etc/nsswitch.conf file. Make sure that you have the following entries:

passwd:   files  nis nisplus
group:      files nis nisplus
hosts:      files nis nisplus dns

Note: The order is important. The server machine will look for the password and hosts information first in its local files, and if it cannot find it there, searches it via the Network Information System.

Add a # before the line beginning with shadow.
 
    1. change some lines in the Makefile at /var/yp/Makefile
       
      • MERGE_PASSWD=false
      • MERGE_GROUP=false
       
    2. Create the NIS (YP) database by running:
       
         $> /usr/lib/yp/ypinit  -m
         
      A line will appear

                next host to add:

      Galaxy26 is already listed as the server, so just press Control - D. Then type in y and press Enter.

      If you need to update a map later, run make in the /var/yp directory, once you add a new user.

    3. Run make:

$> cd /var/yp

$> make

    1. Restart the ypbind daemon:

$> /etc/rc.d/init.d/ypbind restart
                                         

  1. Create a new user with name ypuser and password XXXXX
     
                        $> useradd ypuser
          $> passwd ypuser
Set the password and confirm it.
  1. Update the map by running make in the /var/yp directory. Do this every time you add a new user.


                               $> cd /var/yp


                               $> make

  1. Make sure that the NIS knows about ypuser

    $> ypcat passwd

 

2.4 Printer Configuration (Optional, for reference only)

The /etc/printcap file is the core of Linux printer configuration.  This file contains entries for each printer that is available on your Linux system. When the Linux printer daemon, lpd, is loaded (at boot time), it looks at this file to get information about the printers it will be managing.

To set up a printer on the server system, we will use the Control Panel utility as a configuration tool.

  1. Make sure you have root priveleges.
  2. Start X window system by typing the command
    startx
  3. Launching the Control panel
    From the screen panel (located on the bottom of the screen):
    • Go to Programs->System->Printer Configuration.
    From the Terminal window:
    • Type the control-panel command. The control-panel window pops up.
    • Press the Printer Configuration button.
  4. To add a new printer to your system press New.
  5. In the window called Names and Aliases add Aliase: HP1 and Queue Name: HP1. Then press OK.
  6. In the window Queue Type choose JetDirect Printer for Queue Type and hp1.csm.ornl.gov as Printer IP.
  7. Under Printer Driver set the HP LaserJet 4000. Then press OK.
  8. Finally click Apply to restart the printer demon.
  9. Now you are ready to print.
    • You can do this from the same window by pressing the Tests button, then select the first entry Print ASCII test page and the second one Print Postscript test page.
      or
    • From the Terminal screen, use the lpr command. The -P flag specifies which printer queue to use.
      lpr -PHP1/etc/printcap

3. Client Setup

Our client setup will be done on star1. Reboot the machine before you begin. Then login as root.

3.1 Network Check

  1. Again we will check if the previous network setup during the installation process was successful. For that we will use the ifconfig command.

$> ifconfig

  1. Make sure the ethernet card is set up right. Try to ping yourself and the server. To stop ping, press Ctrl - C

$> ping star1

$> ping 192.168.1.100   (Server IP for Galaxy26)

  1. Now we need to create a list of our favorite hosts. You need to edit the file /etc/hosts, and enter the IP addresses, names and nicks. This will look as follows:

192.168.1.100       galaxy26     galaxy26 (IP address for your local network server)

192.168.1.1           star1            star1

  1. Now ping the server by using its nick:

$> ping galaxy26

  1. Next we set up the daemons, so they automatically start at boot-up.
  1. For the next lab we will need rsh, so lets set it up manually:

$> cd /etc/xinetd.d

$> /etc/rc.d/init.d/xinetd restart

  1. Test rsh by typing:

$> rsh galaxy26

When it asks for the password, interrupt rsh by pressing Ctrl-D.  

Hopefully your network is working now .  If something does not work, you can refer to /var/log/messages to get an idea what the problems are: unknown or uninstalled driver, incorrectly defined path to your modules, etc.

3.2 NFS client

$> /etc/rc.d/init.d/portmap restart

$> mkdir /usr/export

  1. Mount the directory /usr/export from galaxy26 onto the /usr/export directory of your local host.

$> mount  -t   nfs  galaxy26:/usr/export   /usr/export

$> df  (check if /usr/export is there)

Note: NEVER try to mount  the /etc directory unless you are experienced. It is very likely to crash all your settings. And the solution will be to start all over again from the Linux installation.

If you receive an error message that you do not have a permission to do this, make sure  that your machine has  permission to share the resources of the galaxy26 machine.
  1. Check that /usr/export   reflects the content of  /usr/export  directory on galaxy26:
$> cd  /usr/export

$> ls

$> cd

$> umount /usr/export (this will un-mount the /usr/export directory)

$> df

Will /usr/export be mounted from galaxy26 when you reboot your machine?
  1. Next mount the /home directory from galaxy26:

$> umount /home


$> mount -t nfs galaxy26:/home   /home

  1. Edit /etc/fstab file to automate the mount process and auto mount /usr/export  every time you  reboot your machine. The entry in the /etc/fstab file may look as follows:


            galaxy26:/usr/export   /usr/export  nfs     user, exec, dev, suid, rw, defaults   0 0

            galaxy26:/home   /home  nfs     user, exec, dev, suid, rw, defaults   0 0
 

  1. Reboot the machine (shutdown -r now) and make sure that galaxy26:/user/export and  /home are mounted. Now, that  /home and /usr/export are mounted from galaxy26. If not they need to be mounted explicitly.

$> df

3.3 NIS client

Lets set up the NIS for the client now.

  1. Set up the NIS domain by running:
$> domainname workshop
You may specify  any name later.
  1. Make  sure that a new entry has appeared in the /etc/sysconfig/network file:
NISDOMAIN=workshop
Otherwise, add this line manually.
  1. Edit the /etc/yp.conf file by specifying the NIS server:
ypserver galaxy26
domain workshop
  1. Edit the /etc/nsswitch.conf file. Make sure that you have the following entries:
passwd:   nis files nisplus
group:      nis files nisplus
hosts:       files nis nisplus dns
Note: The order is important. The client machine will look for the password and hosts on the server via NIS, and if it cannot find it there, searches it within its local files.

Add a # before the line begin with shadow.

  1. (For checking only) Use setup to ensure all the daemons needed will start automatically at boot time.
  • In the terminal type in command setup.
  • select System Services
  • Press the Enter key
  • select the following daemon with space key:
      ypbind
  • Using the Tab key to get OK and then exit.
  • reboot the computer
  • restart ypbind using the command line

$> /etc/rc.d/init.d/ypbind restart
 

  1. Logout root and login as ypuser. Use the password you defined in the server setup.
  2. Edit the .rhosts file. On all clients and servers you want to be able to use rsh without supplying passwd. The .rhosts file should look like this: (DO NOT DO THIS IN ROOT ACCOUNT!!)

galaxy26

star1

  1. Change the permission of the .rhosts file:

$> chmod g-w .rhosts

$> rsh galaxy26 w (if this works, we are DONE!!!!)

!!! CONGRATULATION !!!!     DONE DONE DONE DONE DONE

Warning:  After the MPI calculations are done, please follow the procedure as listed below to deactiviate RSH and rlogin on the server!!

Type setup to delist RSH and RLOGIN from the services on the server

Edit /etc/xinetd.d/rsh ----> check that disable is set to yes 

$> /etc/rc.d/init.d/xinetd restart

As users, remove galaxy26 from .rhosts file. Use -nolocal option to run MPI applications from server.

3.4 Printer Configuration (Optional, for reference only)

    To set up a printer on the client, we will again use the Control Panel utility as a configuration tool.

    1. Make sure you have root privileges.
    2. Start X window system by typing the command
      $> startx
    3. Launching the Control panel
      From the screen panel (located on the bottom of the screen):
      • Go to Programs->System->Printer Configuration.
      From the Terminal window:
      • Type the control-panel command. The control-panel window pops up.
      • Press the Printer Configuration button.
    4. To add a new printer to your system press New.
    5. In the window called Names and Aliases add Aliase: HP1 and Queue Name: HP1. Then press OK.
    6. In the window Queue Type choose Unix Printer (lpd Queue) for Queue Type and galaxy26 as Printer IP.
    7. Under Printer Driver set the HP LaserJet 4000. Then press OK.
    8. Finally click Apply to restart the printer demon.
    9. Now you are ready to print. The client will sent the print command to the server galaxy26, and from there it will go to the network printer HP1.
4. References
  1. NFS HOWTO (http://www.redhat.com/mirrors/LDP/HOWTO/NFS-HOWTO.html)
  2. SAMBA Home Page (http://www.samba.org)
  3. SMB HOWTO (http://www.redhat.com/mirrors/LDP/HOWTO/SMB-HOWTO.html)
  4. Samba Tips (http://www.redhat.com/support/docs/Samba-Tips/Samba-Tips.html)
  5. Documentation under /usr/doc/samba-version
  6. Man pages: smb.conf, smbclient, testparm, smbstatus, testprns, smbd, nmbd
  7. The Linux NIS HOWTO (http://www.redhat.com/mirrors/LDP/HOWTO/NIS-HOWTO.html)
  8. The Official Red Hat Linux Installation Guide (http://www.redhat.com/docs/manuals/linux/RHL-7.1-Manual/install-guide/)
5. Acknowledgements

We are grateful to all the contributors of LINUX and also people from the following sites.

  1. Argonne National Laboratory
  2. Oak Ridge National Laboratory
  3. Redhat Linux
  4. Kachina Technologies Inc.
  5. GNU Project
     

Joint Institute for Computational Science  http://www.jics.utk.edu/ 
2:22 pm, Oct 01, 2001