You can use SMB (Server Message Block) protocol to access to Red Hat Storage volumes when using Microsoft Windows as well as Linux clients. SMB is also known as CIFS (Common Internet File System). For this access method, SMB Client (CIFS) packages need to be present on the client side. You can export the glusterFS mount point as the Samba export on the server, and then mount it using the SMB protocol on the client.
This section describes how to mount SMB shares on Microsoft Windows-based clients (both manually and automatically) and how to verify that the volume has been mounted successfully.
Note
SMB access using the Mac OS X Finder is not supported. You can, however, use the Mac OS X command line to access Red Hat Storage volumes using SMB.
If you are using Samba with Windows Active Directory, you must install the following packages on the linux client using the following commands:
# yum install samba-winbind# yum install samba-client# yum install krb5-workstation
You can use either of the following methods to mount Red Hat Storage volumes using SMB:
After mounting a volume, you can test the mounted volume using the procedure described in Section 9.3.1.5, “Testing Volumes Mounted Using SMB on Red Hat Enterprise Linux and Windows”.
You can use Samba to export Red Hat Storage volumes through the SMB protocol.
To export volumes through SMB protocol
- Mount a Red Hat Storage volume. For more information on mounting volumes, see Section 9.1.2, “Mounting Red Hat Storage Volumes”.
- Setup the Samba configuration to export the mount point of the Red Hat Storage volume.For example, if a Red Hat Storage volume is mounted on
/mnt/gluster, you must edit the/etc/samba/smb.conffile to enable sharing of Red Hat Storage volumes over SMB. Open the/etc/samba/smb.conffile in a text editor and add the following lines for a simple configuration:[glustertest] comment = For testing a Red Hat Storage volume exported over SMB path = /mnt/gluster read only = no guest ok = yes
Save the changes and start or restart the SMB (Server Message Block) service using your system's init scripts (/etc/init.d/smb [re]start). - Set the SMB password using the following command:
# smbpasswd -a
usernameYou will be prompted for a password, provide the SMB password. This password will be used during the SMB mount.
Note
To be able mount from any server in the trusted storage pool, you must repeat these steps on each Red Hat Storage node. For more advanced configurations, refer to the Samba documentation.
When you start a volume using
gluster volume start VOLNAME command, the volume is automatically exported through Samba on all Red Hat Storage servers running Samba. The Red Hat Storage volume is mounted using the Red Hat Storage Native Client at /mnt/samba/VOLNAME. It is exported as a Samba share named as gluster-VOLNAME.
To disable automatic mounting of volumes through Samba, rename the
S30samba-start.sh located at /var/lib/glusterd/hooks/1/start/post to K30samba-start.sh.
For more information on the above scripts, see Section 14.2, “Prepackaged Scripts”.
You can manually mount Red Hat Storage volumes using SMB on Red Hat Enterprise Linux and Microsoft Windows-based client machines.
To manually mount a Red Hat Storage volume using SMB on Red Hat Enterprise Linux
- Mount the Samba exported SMB share using the following command:
# mount -t cifs
Samba_Server_IP_Address:/Share_Name Mount_PointFor example, if a Red Hat Storage volume is exported through SMB using the/etc/samba/smb.conffile with the following entry:[glustertest] comment = For testing a Red Hat Storage volume exported over SMB path = /mnt/gluster read only = no guest ok = yes
Perform the SMB mount of the Red Hat Storage volume using the following command:# mount -t cifs 192.168.1.60:/glustertest /mnt/smb
To manually mount a Red Hat Storage volume using SMB on Windows
- Using Windows Explorer, choose Tools > Map Network Drive… from the menu. The Map Network Drive window appears.
- Choose the drive letter using the Drive drop-down list.
- In the Folder text box, enter the path of the server and the shared resource in the following format:
\\SERVER_NAME\VOLNAME. - Click Finish.
The network drive (mapped to the volume) appears in the Computer window.
Alternatively, to manually mount a Red Hat Storage volume using SMB
- Click , and then click .
- In the box, enter
cmd. - Enter
net use z: \\, whereSERVER_NAME\VOLNAMEz:is the drive letter you want to assign to the shared volume.For example,net use y: \\server1\test-volume
You can configure your system to automatically mount Red Hat Storage volumes using SMB on Microsoft Windows-based clients each time the system starts.
To automatically mount a Red Hat Storage volume using SMB on Red Hat Enterprise Linux
- To automatically mount a volume, edit the
/etc/fstabfile and add the following line:hostname-or-IPaddress:/Share_Name mountdir smb credentials=filename,_netdev 0 0
For example,server1:/glustertest /mnt/glusterfs smb credentials=/etc/samba/passwd,_netdev 0 0
You must specify the filename and its path that contains username and/or password in thecredentialsoption in/etc/fstabfile. Refer to themount.cifsman page for more information.
To automatically mount a Red Hat Storage volume using SMB on Windows
The network drive (mapped to the volume) appears in the Computer window and is reconnected each time the system starts.
- Using Windows Explorer, choose Tools > Map Network Drive… from the menu. The Map Network Drive window appears.
- Choose the drive letter using the Drive drop-down list.
- In the Folder text box, enter the path of the server and the shared resource in the following format:
\\SERVER_NAME\VOLNAME. - Click the Reconnect at logon checkbox.
- Click Finish.
You can confirm that Red Hat Storage directories are mounting successfully.
To test mounted volumes on Red Hat Enterprise Linux
- Use the
smsbtatuscommand by entering the following:# smbstatus -S
For example, the output of the status command on the client will display an entry similar to the following:Service pid machine Connected at ------------------------------------------------------------------- glustertest 11967 __ffff_192.168.1.60 Mon Aug 6 02:23:25 2012
To test mounted volumes on Windows
- You can confirm that Red Hat Storage directories are mounting successfully by navigating to the directory using Windows Explorer.