Network File System (NFS) Setup


In our computational cluster, we used NFS to allow each computational node to do three things. They were:

  1. Access user directories from NIS Server
  2. Access the Message Passing Interface (MPI) from the master computational node (does not have to be the NIS Server . . . in fact, in our case, it was not)
  3. Access the Sun Grid Engine (SGE) from the master node

The steps necessary to get NFS up and running are:

  1. Choose one machine to be the NFS Server
  2. Configure the this machine to be the NFS Server
  3. Configure the rest of the machines on the network to be clients of this server

This isn't Sophie's Choice, people

My advice is just pick one machine where you would like to physically store all your data. Make it a safe computer. If one of your computers is located in a 400 degree room, don't choose it. If you often lend one of your computers to your accident-prone friend, Earl . . . don't choose that one, either. We ended up choosing Mike's computer because . . . well, mine had the NIS server, and his felt left out.


Configuring the NFS Server

To configure the NFS Server, follow the following steps:

  1. In the /etc/exports file add a line for each client in the format:

    file-system host(rw)

  2. If not already installed, install the packages for:

    portmap
    nfs-utils

  3. Start the NFS services by typing:

    /etc/rc.d/init.d/portmap start
    /etc/rc.d/init.d/nfs start
    /etc/rc.d/init.d/nfslock start

  4. Ensure that the remote procedure call (RPC) services are running by typing:

    /usr/sbin/rpcinfo -p

  5. Every time to modify the /etc/exports file, update the exports by typing:

    /usr/sbin/exportfs -a

  6. Verify exports by typing:

    /usr/sbin/exportfs -v

  7. Ensure that services are started at run time by typing ntsysv and checking in portmap, nfs, and nfslock

Configuring the NFS Client

On each client, do the following:

  1. Verify the server allows you access to its RPC (especially NFS) by typing:

    /usr/sbin/rpcinfo -p server_name

  2. Check which directories the server exports to you by typing:

    /usr/sbin/showmount -e server_name

  3. Set up the automounter to mount these directories as they are needed. The steps to do this are as follows:
    1. If it is not already installed, install the autofs package
    2. Add a line to the /etc/auto.master file that looks like the following:

      /home /etc/auto.home --timeout 60

    3. Create a file called auto.home (or whatever you chose to call it) that looks like this:

      * (server-name):/home

    4. Start the automount daemon by typing:

      /etc/rc.d/init.d/autofs start

    5. Any time you alter any of the NFS maps, type:

      /etc/rc.d/init.d/autofs reload

    6. Ensure that the automounter will start up at run time by typing ntsysv and checking in autofs
    7. To verify that the automounter is running, type:

      /etc/rc.d/init.d/autofs status