Chapter 9. Accessing Data - Setting Up Clients

You can access Red Hat Storage volumes in multiple ways. You can use Native Client method for high concurrency, performance and transparent failover in GNU/Linux clients. You can also use NFS v3 to access 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.
You can use SMB (Server Message Block) to access Red Hat Storage volumes when using Microsoft Windows as well as Samba clients. For this access method, Samba packages need to be present on the client side.

9.1. Native Client

Native Client is a FUSE-based client running in user space. Native Client is the recommended method for accessing Red Hat Storage volumes when high concurrency and high write performance is required.
This section introduces Native Client and explains how to install the software on client machines. This section also describes how to mount Red Hat Storage volumes on clients (both manually and automatically) and how to verify that the Red Hat Storage volume has mounted successfully.

9.1.1. Installing Native Client

After you have successfully installed your client operating system, you must first register the target system to Red Hat Network and subscribe to the Red Hat Enterprise Linux Server channel.
To subscribe to the Red Hat Enterprise Linux Server channel using RHN Classic:
  1. Run the rhn_register command to register the system with Red Hat Network. To complete registration successfully you will need to supply your Red Hat Network username and password.
    # rhn_register
    In the select operating system release page, select All available updates and follow the on screen prompts and complete the registration of the system.
    The system is now registered to rhel-x86_64-server-6 channel.
  2. Subscribe to Red Hat Storage Native Client
    You must subscribe the system to the Red Hat Storage Native Client channel using either the web interface to Red Hat Network or the command line rhn-channel command.
    1. Using the rhn-channel command
      Run the rhn-channel command to subscribe the system to Red Hat Storage Native Client channel. The command which need to be run is:
      # rhn-channel --add --channel=rhel-x86_64-server-rhsclient-6
    2. Using the Web Interface to Red Hat Network.
      To add a channel subscription to a system from the web interface:
      1. Log on to Red Hat Network (http://rhn.redhat.com).
      2. Move the mouse cursor over the Subscriptions link at the top of the screen, and then click the Registered Systems link in the menu that appears.
      3. Select the system to which you are adding Red Hat Storage Native Client channel from the list presented on the screen, by clicking the name of the system.
      4. Click Alter Channel Subscriptions in the Subscribed Channels section of the screen.
      5. On this screen, expand the node for Additional Services Channels for Red Hat Enterprise Linux 6 for x86_64 for RHEL 6 or Additional Services Channels for Red Hat Enterprise Linux 5 for x86_64 for RHEL 5.
      6. Click the Change Subscriptions button to finalize the changes.
        After the page refreshes, select the Details tab to verify if your system is subscribed to the appropriate channels.
      Run the following command to verify if the system is registered successfully.
      # rhn-channel -l
      rhel-x86_64-server-6
      rhel-x86_64-server-rhsclient-6
      The system is now registered with Red Hat Network and subscribed to the Red Hat Storage Native Client channel. Now install the native client RPMs using the following command:
      # yum install glusterfs glusterfs-fuse

Important

All the clients must be of same version. Red Hat strongly recommends you to upgrade your clients before you upgrade the server.
If you are using RHEL 5.x machines, you must load FUSE modules before mounting the Red Hat Storage volumes. Execute the following command to load FUSE modules:
# modprobe fuse
For more information on loading modules at boot time, see https://access.redhat.com/knowledge/solutions/47028 .

9.1.2. Mounting Red Hat Storage Volumes

After installing Native Client, you must mount Red Hat Storage volumes to access data. There are two methods you can choose:
After mounting a volume, you can test the mounted volume using the procedure described in Section 9.1.2.3, “Testing Mounted Volumes”.

Note

Server names selected during creation of volumes should be resolvable in the client machine. You can use appropriate /etc/hosts entries or a DNS server to resolve server names to IP addresses.
Mounting Options
You can specify the following options when using the mount -t glusterfs command. Note that you need to separate all options with commas.
  • backupvolfile-server=server name - name of the backup volfile server to mount the client. If this option is added while mounting fuse client, when the first volfile server fails, then the server specified in backupvolfile-server option is used as volfile server to mount the client.
  • fetch-attempts=number - number of attempts to fetch volume files while mounting a volume. This option is useful when you mount a server with multiple IP addresses or when round-robin DNS is configured for the server name.
  • log-level - logs only specified level or higher severity messages in the log-file.
  • log-file - logs the messages in the specified file.
  • direct-io-mode=[enable|disable]
  • ro - mounts the file system as read only.
  • acl - enables POSIX Access Control List on mount.
  • selinux - enables handling of SELinux xattrs through the mount point.
  • background-qlen=length - this option enables FUSE to handle n number of requests to be queued before stopping to accept new requests. Default value of n is 64.
  • enable-ino32 - this option enables file system to present 32-bit inodes instead of 64- bit inodes.
For example:
# mount -t glusterfs -o backupvolfile-server=volfile_server2,fetch-attempts=2,log-level=WARNING,log-file=/var/log/gluster.log server1:/test-volume /mnt/glusterfs

9.1.2.1. Manually Mounting Volumes

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

    Note

    The server specified in the mount command is only used to fetch the glusterFS configuration volfile describing the volume name. Subsequently, the client will communicate directly with the servers mentioned in the volfile (which might not even include the one used for mount).
    If you see a usage message like Usage: mount.glusterfs, mount usually requires you to create a directory to be used as the mount point. Run mkdir /mnt/glusterfs command before you attempt to run the mount command listed above.

9.1.2.2. Automatically Mounting Volumes

You can configure your system to automatically mount the Red Hat Storage volume each time your system starts.
The server specified in the mount command is only used to fetch the glusterFS configuration volfile describing the volume name. Subsequently, the client will communicate directly with the servers mentioned in the volfile (which might not even include the one used for mount).
To automatically mount a Red Hat Storage volume
  • To mount a volume, edit the /etc/fstab file and add the following line:
    HOSTNAME-OR-IPADDRESS:/VOLNAME MOUNTDIR glusterfs defaults,_netdev 0 0
    For example:
    server1:/test-volume /mnt/glusterfs glusterfs defaults,_netdev 0 0

9.1.2.3. Testing Mounted Volumes

To test mounted volumes
  • Use the following command:
    # mount 
    For example, if the Red Hat Storage volume was successfully mounted, the output of the mount command on the client will display an entry like the following:
    server1:/test-volume on /mnt/glusterfs type fuse.glusterfs(rw,allow_other,default_permissions,max_read=131072
  • Use the following command:
    # df
    The output of df command on the client will display the aggregated storage space from all the bricks in a volume similar to this example:
    # 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