此内容没有您所选择的语言版本。
Chapter 6. Creating Access to Volumes
- Native Client (see Section 6.1, “Native Client”)
- Network File System (NFS) v3 (see Section 6.2, “NFS”)
- Server Message Block (SMB) (see Section 6.3, “SMB”)
Because of differences in locking semantics, a single Red Hat Gluster Storage volume cannot be concurrently accessed by multiple protocols. Current support for concurrent access is defined in the following table.
| SMB | Gluster NFS | NFS-Ganesha | Native FUSE | Object | |
|---|---|---|---|---|---|
| SMB | Yes | No | No | No | No | 
| Gluster NFS | No | Yes | No | No | No | 
| NFS-Ganesha | No | No | Yes | No | No | 
| Native FUSE | No | No | No | Yes | Yes [a] | 
| Object | No | No | No | Yes [a] | Yes | 
| [a] 
						For more information, refer Section 6.5, “Managing Object Store”.
					 | |||||
The following table provides the support matrix for the supported access protocols with TCP/RDMA.
| Access Protocols | TCP | RDMA | 
|---|---|---|
| FUSE | Yes | Yes | 
| SMB | Yes | No | 
| NFS | Yes | Yes | 
Important
6.1. Native Client
- Install Native Client packages
- Mount Red Hat Gluster Storage volumes (manually and automatically)
- Verify that the Gluster Storage volume has mounted successfully
| Red Hat Enterprise Linux version | Red Hat Gluster Storage version | Native client version | 
|---|---|---|
| 6.5 | 3.0 | 3.0, 2.1* | 
| 6.6 | 3.0.2, 3.0.3, 3.0.4 | 3.0, 2.1* | 
| 6.7 | 3.1, 3.1.1, 3.1.2 | 3.1, 3.0, 2.1* | 
| 6.8 | 3.1.3 | 3.1.3 | 
| 6.9 | 3.2 | 3.2, 3.1.3* | 
| 6.9 | 3.3 | 3.3, 3.2 | 
| 6.9 | 3.3.1 | 3.3.1, 3.3, 3.2 | 
| 6.10 | 3.4 | 3.4, 3.3.z | 
| 7.1 | 3.1, 3.1.1 | 3.1.1, 3.1, 3.0 | 
| 7.2 | 3.1.2 | 3.1.2, 3.1, 3.0 | 
| 7.2 | 3.1.3 | 3.1.3 | 
| 7.3 | 3.2 | 3.2, 3.1.3 | 
| 7.4 | 3.2 | 3.2, 3.1.3 | 
| 7.4 | 3.3 | 3.3, 3.2 | 
| 7.4 | 3.3.1 | 3.3.1, 3.3, 3.2 | 
| 7.5 | 3.3.1, 3.4 | 3.3.z, 3.4.z | 
| 7.6 | 3.3.1, 3.4 | 3.3.z, 3.4.z | 
Warning
Warning
- gluster volume heal VOLNAME infois unresponsive for some volumes. (BZ#1500542)
- Gluster brick process crashes frequently. (BZ#1510725)
- Multiple disconnects on NFS mounts. (BZ#1425740)
Warning
- For Red Hat Gluster Storage 3.4, Red Hat supports Red Hat Gluster Storage 3.3 and 3.4 clients only.
- For Red Hat Gluster Storage 3.2, you need to have Red Hat Gluster Storage 3.2 clients. This version is not compatible with backward versions of the client.
6.1.1. Installing Native Client
Important
Use the Command Line to Register and Subscribe a System to Red Hat Subscription Management
Prerequisites
- Know the user name and password of the Red Hat Subscription Manager account with Red Hat Gluster Storage entitlements.
- Run thesubscription-manager registercommand to list the available pools. Select the appropriate pool and enter your Red Hat Subscription Manager user name and password to register the system with Red Hat Subscription Manager.subscription-manager register # subscription-manager registerCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
- Depending on your client, run one of the following commands to subscribe to the correct repositories.- For Red Hat Enterprise Linux 7.x clients:subscription-manager repos --enable=rhel-7-server-rpms --enable=rh-gluster-3-client-for-rhel-7-server-rpms # subscription-manager repos --enable=rhel-7-server-rpms --enable=rh-gluster-3-client-for-rhel-7-server-rpmsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note The following command can also be used, but Red Hat Gluster Storage may deprecate support for this repository in future releases.subscription-manager repos --enable=rhel-7-server-rh-common-rpms # subscription-manager repos --enable=rhel-7-server-rh-common-rpmsCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
- For Red Hat Enterprise Linux 6.1 and later clients:subscription-manager repos --enable=rhel-6-server-rpms --enable=rhel-6-server-rhs-client-1-rpms # subscription-manager repos --enable=rhel-6-server-rpms --enable=rhel-6-server-rhs-client-1-rpmsCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
- For Red Hat Enterprise Linux 5.7 and later clients:subscription-manager repos --enable=rhel-5-server-rpms --enable=rhel-5-server-rhs-client-1-rpms # subscription-manager repos --enable=rhel-5-server-rpms --enable=rhel-5-server-rhs-client-1-rpmsCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
 For more information, see Section 3.2 Registering from the Command Line in Using and Configuring Red Hat Subscription Management.
- Verify that the system is subscribed to the required repositories.yum repolist # yum repolistCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
Use the Web Interface to Register and Subscribe a System
Prerequisites
- Know the user name and password of the Red Hat Subsrciption Management (RHSM) account with Red Hat Gluster Storage entitlements.
- Log on to Red Hat Subscription Management (https://access.redhat.com/management).
- Click the Systems link at the top of the screen.
- Click the name of the system to which the Red Hat Gluster Storage Native Client channel must be appended.
- Click in the Subscribed Channels section of the screen.
- Expand the node for Additional Services Channels forRed Hat Enterprise Linux 7 for x86_64orRed Hat Enterprise Linux 6 for x86_64or forRed Hat Enterprise Linux 5 for x86_64depending on the client platform.
- Click the button to finalize the changes.When the page refreshes, select the Details tab to verify the system is subscribed to the appropriate channels.
Install Native Client Packages
Prerequisites
- Run theyum installcommand to install the native client RPM packages.yum install glusterfs glusterfs-fuse # yum install glusterfs glusterfs-fuseCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
- For Red Hat Enterprise 5.x client systems, run themodprobecommand to load FUSE modules before mounting Red Hat Gluster Storage volumes.modprobe fuse # modprobe fuseCopy to Clipboard Copied! Toggle word wrap Toggle overflow For more information on loading modules at boot time, see https://access.redhat.com/knowledge/solutions/47028 .
6.1.2. Upgrading Native Client
Warning
- Unmount gluster volumes Unmount any gluster volumes prior to upgrading the native client.- umount /mnt/glusterfs - # umount /mnt/glusterfs- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Upgrade the client Run the- yum updatecommand to upgrade the native client:- yum update glusterfs glusterfs-fuse - # yum update glusterfs glusterfs-fuse- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Remount gluster volumes Remount volumes as discussed in Section 6.1.3, “Mounting Red Hat Gluster Storage Volumes”.
6.1.3. Mounting Red Hat Gluster Storage Volumes
Note
- Clients should be on the same version as the server, and at least on the version immediately previous to the server version. For Red Hat Gluster Storage 3.4, the recommended native client version should either be 3.4 or 3.3.z. For other versions, see Section 6.1, “Native Client”.
- Server names selected during volume creation should be resolvable in the client machine. Use appropriate/etc/hostsentries, or a DNS server to resolve server names to IP addresses.
- Internet Protocol Version 6 (IPv6) support is available only for Red Hat Hyperconverged Infrastructure for Virtualization environments and not for Red Hat Gluster Storage standalone environments.
6.1.3.1. Mount Commands and Options
mount -t glusterfs command. All options must be separated with commas.
				mount -t glusterfs -o backup-volfile-servers=volfile_server2:volfile_server3:.... ..:volfile_serverN,transport-type tcp,log-level=WARNING,reader-thread-count=2,log-file=/var/log/gluster.log server1:/test-volume /mnt/glusterfs
# mount -t glusterfs -o backup-volfile-servers=volfile_server2:volfile_server3:.... ..:volfile_serverN,transport-type tcp,log-level=WARNING,reader-thread-count=2,log-file=/var/log/gluster.log server1:/test-volume /mnt/glusterfs- backup-volfile-servers=<volfile_server2>:<volfile_server3>:...:<volfile_serverN>
- List of the backup volfile servers to mount the client. If this option is specified while mounting the fuse client, when the first volfile server fails, the servers specified inbackup-volfile-serversoption are used as volfile servers to mount the client until the mount is successful.Note This option was earlier specified asbackupvolfile-serverwhich is no longer valid.
- log-level
- Logs only specified level or higher severity messages in thelog-file.
- log-file
- Logs the messages in the specified file.
- transport-type
- Specifies the transport type that FUSE client must use to communicate with bricks. If the volume was created with only one transport type, then that becomes the default when no value is specified. In case oftcp,rdmavolume, tcp is the default.
- dump-fuse
- This mount option creates dump of fuse traffic between the glusterfs client (fuse userspace server) and the kernel. The interface to mount a glusterfs volume is the standard mount(8) command from the CLI. This feature enables the same in the mount option.# mount -t glusterfs -odump-fuse=filename hostname:/volname mount-pathFor example,mount -t glusterfs -odump-fuse=/dumpfile 10.70.43.18:/arbiter /mnt/arbiter # mount -t glusterfs -odump-fuse=/dumpfile 10.70.43.18:/arbiter /mnt/arbiterCopy to Clipboard Copied! Toggle word wrap Toggle overflow The above command generates a binary file with the namedumpfile.Note The fusedump grows large with time and notably if the client gets a heavy load. So this is not an intended use case to do fusedump during normal usage. It is advised to use this to get a dump from a particular scenario, for diagnostic purposes.You need to unmount and remount the volume without the fusedump option to stop dumping.
- ro
- Mounts the file system with read-only permissions.
- acl
- Enables POSIX Access Control List on mount. See Section 6.4.4, “Checking ACL enablement on a mounted volume” for further information.
- background-qlen=n
- Enables FUSE to handle n number of requests to be queued before subsequent requests are denied. Default value of n is 64.
- enable-ino32
- Enables file system to present 32-bit inodes instead of 64-bit inodes.
- reader-thread-count=n
- Enables FUSE to add n number of reader threads that can give better I/O performance. Default value of n is1.
- lru-limit
- Thismountcommand option clears the inodes from the least recently used (lru) list (which keeps non-referenced inodes) after the inode limit has reached.For example,mount -olru-limit=NNNN -t glusterfs hostname:/volname /mnt/mountdir # mount -olru-limit=NNNN -t glusterfs hostname:/volname /mnt/mountdirCopy to Clipboard Copied! Toggle word wrap Toggle overflow Where NNNN is a positive integer. The default value of NNNN is 128k (131072) and the recommended value is 20000 and above. If0is specified as thelru-limitthen it means that no invalidation of inodes from the lru-list.
6.1.3.2. Mounting Volumes Manually
Manually Mount a Red Hat Gluster Storage Volume or Subdirectory
- For a Red Hat Gluster Storage Volume
- mount -t glusterfs HOSTNAME|IPADDRESS:/VOLNAME /MOUNTDIR
- For a Red Hat Gluster Storage Volume's Subdirectory
- mount -t glusterfs HOSTNAME|IPADDRESS:/VOLNAME/SUBDIRECTORY /MOUNTDIR
Note
- If a mount point has not yet been created for the volume, run themkdircommand to create a mount point.mkdir /mnt/glusterfs # mkdir /mnt/glusterfsCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
- Run themount -t glusterfscommand, using the key in the task summary as a guide.- For a Red Hat Gluster Storage Volume:mount -t glusterfs server1:/test-volume /mnt/glusterfs # mount -t glusterfs server1:/test-volume /mnt/glusterfsCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
- For a Red Hat Gluster Storage Volume's Subdirectorymount -t glusterfs server1:/test-volume/sub-dir /mnt/glusterfs # mount -t glusterfs server1:/test-volume/sub-dir /mnt/glusterfsCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
 
6.1.3.3. Mounting Volumes Automatically
- Open the/etc/fstabfile in a text editor.
- Append the following configuration to thefstabfile:- For a Red Hat Gluster Storage Volume
- HOSTNAME|IPADDRESS:/VOLNAME /MOUNTDIR glusterfs defaults,_netdev 0 0 - HOSTNAME|IPADDRESS:/VOLNAME /MOUNTDIR glusterfs defaults,_netdev 0 0- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- For a Red Hat Gluster Storage Volume's Subdirectory
- HOSTNAME|IPADDRESS:/VOLNAME/SUBDIRECTORY /MOUNTDIR glusterfs defaults,_netdev 0 0 - HOSTNAME|IPADDRESS:/VOLNAME/SUBDIRECTORY /MOUNTDIR glusterfs defaults,_netdev 0 0- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 Using the example server names, the entry contains the following replaced values.server1:/test-volume /mnt/glusterfs glusterfs defaults,_netdev 0 0 server1:/test-volume /mnt/glusterfs glusterfs defaults,_netdev 0 0Copy to Clipboard Copied! Toggle word wrap Toggle overflow ORserver1:/test-volume/subdir /mnt/glusterfs glusterfs defaults,_netdev 0 0 server1:/test-volume/subdir /mnt/glusterfs glusterfs defaults,_netdev 0 0Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you want to specify the transport type then check the following example:server1:/test-volume /mnt/glusterfs glusterfs defaults,_netdev,transport=tcp 0 0 server1:/test-volume /mnt/glusterfs glusterfs defaults,_netdev,transport=tcp 0 0Copy to Clipboard Copied! Toggle word wrap Toggle overflow ORserver1:/test-volume/sub-dir /mnt/glusterfs glusterfs defaults,_netdev,transport=tcp 0 0 server1:/test-volume/sub-dir /mnt/glusterfs glusterfs defaults,_netdev,transport=tcp 0 0Copy to Clipboard Copied! Toggle word wrap Toggle overflow 
- Provides namespace isolation so that multiple users can access the storage without risking namespace collision with other users.
- Prevents the root file system from becoming full in the event of a mount failure.
mount -t glusterfs hostname:/volname/subdir /mount-point
# mount -t glusterfs hostname:/volname/subdir /mount-pointmount -t glusterfs hostname:/volname -osubdir-mount=subdir /mount-point
# mount -t glusterfs hostname:/volname -osubdir-mount=subdir /mount-pointgluster volume set test-vol auth.allow "/(192.168.10.*|192.168.11.*),/subdir1(192.168.1.*),/subdir2(192.168.8.*)”
# gluster volume set test-vol auth.allow "/(192.168.10.*|192.168.11.*),/subdir1(192.168.1.*),/subdir2(192.168.8.*)”- Theauth.allowoption allows only the directories specified as the value of theauth.allowoption to be mounted.
- Each group of auth-allow is separated by a comma (,).
- Each group has a directory separated by parentheses,(), which contains the valid IP addresses.
- All subdirectories start with/, that is, no relative path to a volume, but everything is an absolute path, taking/as the root directory of the volume.
Note
*, where any given subdirectory in a volume can be mounted by all clients.
					6.1.3.5. Testing Mounted Volumes
Testing Mounted Red Hat Gluster Storage Volumes
Prerequisites
- Run themountcommand to check whether the volume was successfully mounted.mount # mount server1:/test-volume on /mnt/glusterfs type fuse.glusterfs(rw,allow_other,default_permissions,max_read=131072Copy to Clipboard Copied! Toggle word wrap Toggle overflow ORmount # mount server1:/test-volume/sub-dir on /mnt/glusterfs type fuse.glusterfs(rw,allow_other,default_permissions,max_read=131072Copy to Clipboard Copied! Toggle word wrap Toggle overflow If transport option is used while mounting a volume, mount status will have the transport type appended to the volume name. For example, for transport=tcp:mount # mount server1:/test-volume.tcp on /mnt/glusterfs type fuse.glusterfs(rw,allow_other,default_permissions,max_read=131072Copy to Clipboard Copied! Toggle word wrap Toggle overflow ORmount # mount server1:/test-volume/sub-dir.tcp on /mnt/glusterfs type fuse.glusterfs(rw,allow_other,default_permissions,max_read=131072Copy to Clipboard Copied! Toggle word wrap Toggle overflow 
- Run thedfcommand to display the aggregated storage space from all the bricks in a volume.df -h /mnt/glusterfs # df -h /mnt/glusterfs Filesystem Size Used Avail Use% Mounted on server1:/test-volume 28T 22T 5.4T 82% /mnt/glusterfsCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
- Move to the mount directory using thecdcommand, and list the contents.cd /mnt/glusterfs ls # cd /mnt/glusterfs # lsCopy to Clipboard Copied! Toggle word wrap Toggle overflow