Gluster: How I installed it (nasos1,2)

Good Web resources about Gluster and Samba

Performance Testing - Gluster Docs

http://gluster.readthedocs.io/en/latest/Administrator%20Guide/Performance%20Testing/

HowTos/GlusterFSonCentOS - CentOS Wiki

https://wiki.centos.org/HowTos/GlusterFSonCentOS

SpecialInterestGroup/Storage/gluster-Quickstart - CentOS Wiki

https://wiki.centos.org/SpecialInterestGroup/Storage/gluster-Quickstart

Install GlusterFS Server And Client On CentOS 7 | Unixmen

https://www.unixmen.com/install-glusterfs-server-client-centos-7/

HW

HP ProLiant MicroServer Gen8, G1610T/4GB/B120i [datasheet]

BIOS/CentOS Installation

BIOS: (F9 on second screen, F11 is the BOOT menu)

Sytem Options -> SATA...-> Embeded SATA...->Enable SATA Legacy Mode [does it matter?]
ServiceOptions->Processor Power & Util.. -> Disable [not really important?]
Standard Boot Order->[select Hard Drive C:] [enter] Set the IPL...Order to 1
Boot Ctrlr Order : you may need to swap 1<->2

CentOS installation:

safe graphics mode installation [not really important?]
Apply Sec. policy = OFF [does it matter?]

After the installation

mkdir -p ~/.ssh && touch  ~/.ssh/authorized_keys && chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys
echo "............... ndemou@ndemoupc" >> ~/.ssh/authorized_keys
#--------------
hostname nasos1.mazars-gr.local
echo "HOSTNAME=nasos1.mazars-gr.local" >> /etc/sysconfig/network
cat << __EOF__ >> /etc/hosts
127.0.0.1   nasos1.mazars-gr.local
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.1.11.142 nasos1.mazars-gr.local nasos1
10.1.11.143 nasos2.mazars-gr.local nasos2
__EOF__
yum -y install lvm2 gdisk mdadm firewalld # basic stuf we need
yum -y install dstat wget # usefull utilities
yum -y install centos-release-gluster # this adds the gluster repo 
yum -y install glusterfs glusterfs-fuse glusterfs-server 
#umount /data/
parted /dev/sda 
#------------START OF parted COMMANDS------------
unit MB                                                          
rm 5
print free
mkpart lvmpart xfs 15874MB 3000593MB
set 5 lvm on                                                     
quit
#------------END OF parted COMMANDS------------
sgdisk /dev/sda -R /dev/sdb
sgdisk -G /dev/sdb
sgdisk /dev/sda -R /dev/sdc
sgdisk -G /dev/sdc
mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sd[abc]5
pvcreate /dev/md0
vgcreate vg1 /dev/md0
pvdisplay && vgdisplay
lvcreate --name lvgfs --extents 1423160 vg1
mkfs.xfs -i size=512 /dev/mapper/vg1-lvgfs
#blkid /dev/mapper/vg1-lvgfs

mkdir /gluster
mkdir /gluster/brick2
mount /dev/vg1/lvgfs /gluster/brick2


echo "/dev/vg1/lvgfs /gluster/brick2  xfs  rw,noatime,inode64,nouuid 1 2" >> /etc/fstab
mkdir /gluster/brick2/brick

yum install  -y
systemctl start firewalld.service
firewall-cmd --zone=public --add-service=glusterfs
firewall-cmd --zone=public --add-service=glusterfs --permanent
systemctl start glusterd
systemctl enable glusterd
gluster peer status
##gluster  volume create volume1   nasos1:/gluster/brick1/brick/ 
##gluster volume start volume1
## test from a client with: mount -t glusterfs -o acl nasos1:/volume1 /mnt/temp/

gluster volume create rep-volume replica 2 nasos1.mazars-gr.local:/gluster/brick1/brick/ nasos2.mazars-gr.local:/gluster/brick2/brick/
gluster volume start rep-volume
# test from a client with: mount -t glusterfs -o acl nasos1:/rep-volume /mnt/temp/

Samba setup on nasos

https://wiki.samba.org/index.php/Setting_up_Samba_as_a_Domain_Member

SAMBA setup on nasos1

based on https://wiki.centos.org/HowTos/GlusterFSonCentOS
yum install samba samba-client samba-common samba-vfs-glusterfs -y
# original line was the following but I don't use SElinux
# yum install samba samba-client samba-common samba-vfs-glusterfs selinux-policy-targeted -y
systemctl enable smb.service
systemctl enable nmb.service

# restart the volume and it will be added to smb.conf (magic!)
gluster volume stop rep-volume
gluster volume start rep-volume 

# set some volume properties necessary for samba
gluster volume set rep-volume stat-prefetch off
gluster volume set rep-volume server.allow-insecure on
gluster volume set rep-volume storage.batch-fsync-delay-usec 0

# Verify an entry for rep-volume automagicaly appeard
# and add this line at that entry:
#    kernel share modes = No
vi /etc/samba/smb.conf

# syntax check of smb.conf
testparm

# Add the following line to /etc/glusterfs/glusterd.vol
# on 

EACH AND EVERY NODE :
#   option rpc-auth-allow-insecure on
vi /etc/glusterfs/glusterd.vol
# restart samba and configure firewall
systemctl restart smb.service
systemctl restart nmb.service
firewall-cmd --zone=public --add-service=samba --add-service=samba-client --permanent
firewall-cmd --reload

# test your share with with
smbclient -L 10.30.0.21
# and with
smbclient //10.30.0.21/gluster-rep-volume

Regarding dual naming (\\files is an alias of \\nasos1)

from https://lists.samba.org/archive/samba/2010-June/156591.html

One thing to note is that a machine can have more than one hostname as
well as more than one DNS record.

I was able to get someone joined by putting everything in the /etc/hosts
file:
127.0.0.1 localhost.localdomain localhost
10.112.28.54 name1.domain.local name1 name2.domain.local name2 

The smb.conf setup you have should not need to be modified.
1/2/2017
Topic revision: r4 - 08 Jun 2024, NickDemou
Copyright © enLogic