All HowTo's Linux Redhat, Fedora and CentOS Linux

How to Integrate Gluster and Samba4 on CentOS7 and RHEL

This article extends on a previous article focused on installing and performance testing Gluster on CentOS 7. You can see that article here.

Here we’ll be focusing on installing Samba4 and using Gluster as the back-end storage solution. We could use the Gluster FUSE method but Samba4 comes with a more integrated way. You can read about that here.

Continuing from the previous article, we’ll be using the same systems as before but if you’re simply here to install Samba4 with Gluster, you can ignore references to the previous details. To that end, we’re installing Samba4 server on the host “server1” with IP address “10.0.1.229”.

Make sure to install the packages required for Samba4. CentOS 7 defaults to Samba 4 when using yum for the installation.

yum install samba samba-client samba-common samba-vfs-glusterfs
setsebool -P samba_load_libgfapi 1
systemctl enable smb

Create the root users password.

smbpasswd -a root

Add the Samba share. My example below works with our previously configured Gluster volume named “gvol0”.

[gvol0]
	browseable = yes
	writeable = yes
	comment = Gluster Gvol0
	path = /
	kernel share modes = no
	vfs objects = glusterfs
	glusterfs:volume = gvol0
    	glusterfs:volfile_server = server1

The following is the complete Samba “/etc/samba/smb.conf” file.

[global]
	workgroup = SAMBA
	security = user

	passdb backend = tdbsam

	printing = cups
	printcap name = cups
	load printers = no
	cups options = raw

[gvol0]
	browseable = yes
	writeable = yes
	comment = Gluster Gvol0
	path = /
	kernel share modes = no
	vfs objects = glusterfs
	glusterfs:volume = gvol0
    	glusterfs:volfile_server = server1

[gvol1]
	browseable = yes
	writeable = yes
	comment = Gluster Gvol1
	path = /
	kernel share modes = no
	vfs objects = glusterfs
	glusterfs:volume = gvol1
    	glusterfs:volfile_server = server1

Any changes to the “/etc/samba/smb.conf” requires a Samba restart.

systemctl restart smb

On Client1

In the next section we’ll do a speed test in the same way we did in the previous article. The difference here is that we’ll do the test over the SMB protocol rather than Gluster FUSE.

Install the required Samba client packages on “client1”.

yum install samba-client cifs-utils
mkdir /mnt/samba-gvol0
mkdir /mnt/samba-gvol1
mount -t cifs //server1/gvol0 /mnt/samba-gvol0/
mount -t cifs //server1/gvol1 /mnt/samba-gvol1/

Speed testing

This brings us to the testing phase. We’ll be testing using the same method as in the previous article. I wrote a very small script to test the speed of both volumes. The test is very simple; to see how long it takes to sequentially write 100 file of 1MB each (total 100MB) to the volume using the Samba client on the client system and Samba server on the server system. The table below shows my results.

Note: The results below are very similar to the native FUSE client method tested earlier in the previous article

Our tests requires an SMB mount from “client1” at “10.0.1.232” to the Gluster server “server1” at “10.0.1.229”.

Test Number Volume Name Seconds Taken
1 gvol0 / Replica 3.1
2 gvol0 / Replica 3.1
3 gvol0 / Replica 3.5
4 gvol0 / Replica 3.3
5 gvol1 / Disperse 1.8
6 gvol1 / Disperse 2.4
7 gvol1 / Disperse 1.7
8 gvol1 / Disperse 2.4

Leave a Reply

Your email address will not be published. Required fields are marked *