9.2. NFS

You can use NFS v3 to access to Red Hat Storage volumes. Linux and other operating systems that support the NFSv3 standard may use NFS to access the Red Hat Storage volumes. However, there may be some differences in implementation of the NFSv3 standard by different operating systems which may lead to some issues. You can contact your Red Hat representative for more information on compatibility of Red Hat Storage Server for your specific client operating system and known issues that may exist.
Red Hat Storage 2.0 includes network lock manager (NLM) v4. NLM protocol allows NFSv3 clients to lock files across the network. NLM is required to make applications running on top of NFSv3 mount points to use the standard fcntl() (POSIX) and flock() (BSD) lock system calls to synchronize access across clients.
This section describes how to use NFS to mount Red Hat Storage volumes (both manually and automatically) and how to verify that the volume has been mounted successfully.

9.2.1. Using NFS to Mount Red Hat Storage Volumes

You can use either of the following methods to mount Red Hat Storage volumes:
After mounting a volume, you can test the mounted volume using the procedure described in Section 9.2.1.3, “Testing Volumes Mounted Using NFS”.

9.2.1.1. Manually Mounting Volumes Using NFS

To manually mount a Red Hat Storage volume using NFS
  • To mount a volume, use the following command:
    # mount -t nfs -o vers=3 HOSTNAME-OR-IPADDRESS:/VOLNAME MOUNTDIR
    For example:
    # mount -t nfs -o vers=3 server1:/test-volume /mnt/glusterfs

    Note

    glusterFS NFS server does not support UDP. If a NFS client such as Solaris client, connects by default using UDP, the following message appears:
    requested NFS version or transport protocol is not supported.
    To connect using TCP
  • Add the following option to the mount command:
    -o mountproto=tcp
    For example:
    # mount -o mountproto=tcp -t nfs server1:/test-volume /mnt/glusterfs
To mount Red Hat Storage NFS server from a Solaris Client
  • Use the following command:
    # mount -o proto=tcp,vers=3 nfs://hostname-or-IPaddress:38467/volname mountdir
    For example:
    # mount -o proto=tcp,vers=3 nfs://server1:38467/test-volume /mnt/glusterfs

9.2.1.2. Automatically Mounting Volumes Using NFS

You can configure your system to automatically mount Red Hat Storage volumes using NFS each time the system starts.
To automatically mount a Red Hat Storage volume using NFS
  • To mount a volume, edit the /etc/fstab file and add the following line:
    hostname-or-IPaddress:/volname mountdir nfs defaults,_netdev,vers=3 0 0
    For example:
    server1:/test-volume /mnt/glusterfs nfs defaults,_netdev,vers=3 0 0

    Note

    glusterFS NFS server does not support UDP. If a NFS client such as Solaris client, connects by default using UDP, the following message appears:
    requested NFS version or transport protocol is not supported.
    To connect using TCP
  • Add the following entry in /etc/fstab file:
    hostname-or-IPaddress:/volname mountdir nfs defaults,_netdev,mountproto=tcp 0 0
    For example:
    server1:/test-volume /mnt/glusterfs nfs defaults,_netdev,mountproto=tcp 0 0
To automount NFS mounts
Red Hat Storage supports Linux, UNIX, and similar operating system's standard method of automounting NFS mounts. Update the /etc/auto.master and /etc/auto.misc and restart the autofs service. After that, whenever a user or process attempts to access the directory it will be mounted in the background.

9.2.1.3. Testing Volumes Mounted Using NFS

You can confirm that Red Hat Storage directories are mounting successfully.
To test mounted volumes
  • Use the mount command by entering the following:
    # mount
    For example, the output of the mount command on the client will display an entry similar to the following:
    server1:/test-volume on /mnt/glusterfs type nfs (rw,vers=3,addr=server1)
  • Use the df command by entering the following:
    # df
    For example, the output of df command on the client will display the aggregated storage space from all the bricks in a volume.
    # df -h /mnt/glusterfs 
    Filesystem              Size Used Avail Use% Mounted on 
    server1:/test-volume    28T  22T  5.4T  82%  /mnt/glusterfs
  • Change to the directory and list the contents by entering the following:
    # cd MOUNTDIR
    # ls
    For example:
    # cd /mnt/glusterfs
    # ls