cluster:Nfs/3

From Dgiref
Jump to: navigation, search
Please open a NGI-DE ticket if you experience any Installation or Configuration problem.

Contents

Nfs/3/server

Prepare

Operating system
Scientific Linux version 4.7 64 bit

Optimizing the configuration:


Use minimal operating system installation without firewall. To verify installed packages use the command

  • rpm -qa | grep package_name

Install the following additional packages:

  • yum -y install wget yum rpm make gcc gcc-c++ tar sed zlib openssl

After the installation is complete, turn off any unnecessary services (like gpm, sendmail, cups, haldaemon, messagebus, pcmcia, anacron, atd) with the following command:

  • chkconfig <SERVICE> off

Configure the following settings for the server:

Note-icon.png
  
Prepare new hard disk
  • To export a brand new disk through nfs, the corresponding device in the /dev directory must be find (use the boot log messages from /var/log). Lets assume that the new device is /dev/hdg.
  • Create the new partition on your disk with the command: fdisk /dev/hdg. Follow the instructions and create one big partition /dev/hdg1.
  • Format the new partition with the ext3 file system with the following command: mkfs -t ext3 -c /dev/hdg1 ("-c" options search for invalid disk sectors).
  • Create the new export directory (/srv/nfs) and change the permission to 1777 and mount the partition on it.
  • The new device will be mounted on boot on the selected directory.
Firewall configuration

Install

Probably, the operating system has nfs service installed. To be sure, the following packages will be installed:

  • nfs-utils
  • portmap
  • quota


Configure

The NFS server has to be configured to export filesets, like the users home directories, the system software (etc/profile.d, ogsadai), the VO specific software areas, the UNICORE filespace. Server in D-Grid reference installation exports only one directory, located into /srv/nfs with the following attributes:

Export Export options Node Mountpoint Mount options
nfs /srv/nfs rw,async alle /srv/nfs nosuid

Another requirements are to configure /etc/hosts.deny and /etc/hosts.allow configurations files. Add lines like the following (template: daemon_name: ALL):

cat /etc/hosts.deny
portmap: ALL
lockd: ALL
statd: ALL
mountd: ALL
rquotad: ALL

In the file /etc/hosts.allow the lines for each of the five daemons:

  1. portmap
  2. lockd
  3. statd
  4. mountd
  5. rquotad

should look like this (template: daemon_name: ip.pc.client1, ip.pc.client2):

cat /etc/hosts.allow
portmap: ip.pc.client1, ip.pc.client2
lockd: ip.pc.client1, ip.pc.client2
statd: ip.pc.client1, ip.pc.client2
mountd: ip.pc.client1, ip.pc.client2
rquotad: ip.pc.client1, ip.pc.client2


Proceed

To run an NFS server, the portmap service must be running. To verify that portmap is active, type the following command as root:

service portmap status
  • If the portmap service status is running, then
    • the nfs service can be started with:service nfs start
    • the nfslock service can be started with:service nfslock start.
  • Else execute: service portmap start and after successful report,
    • the nfs service can be started with:service nfs start
    • the nfslock service can be started with:service nfslock start.
Note-icon.png
  
By default, the nfs service does not start automatically at boot time. To configure the NFS to start up at boot time, use an initscript utility, such as /sbin/chkconfig, /sbin/ntsysv, or the Services Configuration Tool program.


Initial test

Verify that all necessary daemons are running. Use rpcinfo -p

# should be something like this: 
program vers proto   port
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp    719  status
    100024    1   tcp    722  status
    100011    1   udp    847  rquotad
    100011    2   udp    847  rquotad
    100011    1   tcp    850  rquotad
    100011    2   tcp    850  rquotad
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100003    4   udp   2049  nfs
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100021    1   udp  32775  nlockmgr
    100021    3   udp  32775  nlockmgr
    100021    4   udp  32775  nlockmgr
    100021    1   tcp  32789  nlockmgr
    100021    3   tcp  32789  nlockmgr
    100021    4   tcp  32789  nlockmgr
    100005    1   udp    863  mountd
    100005    1   tcp    866  mountd
    100005    2   udp    863  mountd
    100005    2   tcp    866  mountd
    100005    3   udp    863  mountd
    100005    3   tcp    866  mountd


Update

There are some software managers (e.g. yum, yast) for operating systems which do the job well for update and new installation for packages. Please see the appropriate attributes for current task in the manuals for them (use man yum).

Please open a NGI-DE ticket if you experience any Installation or Configuration problem.

Nfs/3/client

Prepare

NFS shares are mounted on the client side using the mount command. The format of the command is as follows:

mount -t <nfs-type> -o <options> <nfs_server_host>:</remote/export> </local/directory>

where <nfs-type> one from {nfs, nfs4}, <options> - a comma separated list of options for the NFS file system (refer to Common NFS Mount Options for details). Reference installation use the singe mount point, hence </remote/export> and </local/directory> are /srv/nfs.


Firewall configuration

Install

The Linux operating system offers two methods for mounting remote file systems:

  • manually, with mount service (using a /etc/fstab configuration file)
  • automatically at boot time with the autofs service (using a main configuration file /etc/auto.master and set of auto.* files)

The reference installation use the first, manual method, hence the mount service should be installed. Probably, the operating system has nfs service installed. To be sure, the following packages can be additionally installed:

  • nfs-utils
  • portmap
  • quota

Configure

With the daemons portmap, lockd, statd, mountd running NFS client should be able to mount the remote directory /srv/nfs and after creates the soft links to the mounted /srv/nfs subdirectories.


Proceed

To communicate with an NFS server, the portmap service must be running. To verify that portmap is active, type the following command as root:

service portmap status
  • If the portmap service status is running, then
    • the nfs service can be started with:service nfs start
    • the nfslock service can be started with:service nfslock start
    • the mount service can be started with:service nfslock start.
  • Else execute: service portmap start and after successful report,
    • the nfs service can be started with:service nfs start
    • the nfslock service can be started with:service nfslock start
    • the mount service can be started with:service nfslock start.
Note-icon.png
  
By default, the nfs service does not start automatically at boot time. To configure the NFS to start up at boot time, use an initscript utility, such as /sbin/chkconfig, /sbin/ntsysv, or the Services Configuration Tool program.

Initial test

Lists the contents of the mounted directory with ls command.


WARNING: Possible troubles with mount

Problem 1

mount: sn05:/var/spool/pbs/server_logs failed, reason given by server: Permission denied

Possible solution: Check iptables and /etc/hosts.allow; /etc/hosts.deny

Problem 2

mount clntudp_create: RPC: Program not registered

Possible solution: chmod 644 /etc/hosts.allow


Update

Use the operating system package managers to implement updates, upgrades and to delete a package. Specifically for the nfs updates and patches, refer into the following online resource: http://www.linux-nfs.org/

Personal tools