hostnamectl set-hostname glusterX.szpp.local
/etc/hosts
gluster17.szpp.local 10.10.7.117
gluster18.szpp.local 10.10.7.118
Napravite instalaciju potrebnih paketa i repozitorija, ugasiti firewall i prebaciti SELinux u permissive mod
yum –y update
yum -y install centos-release-gluster37
wget –O /etc/yum.repos.d/gluster.repo http://bit.ly/2ror0PO
ili puni link https://download.gluster.org/pub/gluster/glusterfs/3.7/LATEST/EPEL.repo/glusterfs-epel.repo)
rpm –ivh http://bit.ly/1L5Ikxb
ili puni link https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm)
yum –y update
yum –y install glusterfs glusterfs-cli glusterfs-libs glusterfs-server samba
systemctl disable firewalld.service
systemctl stop firewalld.service
setenforce 0
Napraviti konfiguraciju drugog diska za korištenje u gluster filesystemu:
pvcreate /dev/sdb
vgcreate vg_cluster /dev/sdb
lvcreate –L 5G –n brick1 vg_cluster
lvcreate –L 5G –n brick2 vg_cluster
mkfs.xfs /dev/vg_cluster/brick1
mkfs.xfs /dev/vg_cluster/brick2
mkdir –p /bricks/brick1
mkdir –p /bricks/brick2
mount /dev/vg_cluster/brick1 /bricks/brick1
mount /dev/vg_cluster/brick2 /bricks/brick2
Time smo napravili LVM konfiguraciju sa volume grupom koja se zove vg_cluster, u kojoj smo napravili dva logička volumena od 5GB, imena brick1 i brick2, koje smo formatirali sa XFS filesystemom i montirali ih u direktorije /bricks/brick1 i /bricks/brick2
/etc/fstab
/dev/vg_cluster/brick1 /bricks/brick1 xfs defaults 0 0
/dev/vg_cluster/brick2 /bricks/brick2 xfs defaults 0 0
mount –a
/etc/sysconfig/selinux
umjesto linije SELINUX=enforcing stavite SELINUX=disabled
Opcija će postati aktivna nakon idućeg restarta servera
systemctl enable glusterd.service
systemctl start glusterd.service
gluster peer probe gluster17.szpp.local
gluster peer status
mkdir /bricks/brick1/brick
gluster volume create glustervol1 replica 2 transport tcp gluster17.szpp.local:/bricks/brick1/brick gluster18.szpp.local:/bricks/brick1/brick
gluster volume start glustervol1
gluster volume info all
Konfiguracija CIFS prustupa gluster clusteru
yum –y install samba samba-client samba-common samba-vfs-glusterfs selinux-policy-targeted
systemctl start smb.service
systemctl enable smb.service
systemctl start nmb.service
systemctl enable nmb.service
/etc/samba/smb.conf
Na kraj dodati:
kernel share modes = No
gluster volume set glustervol1 stat-prefetch off
gluster volume set glustervol1 server.allow-insecure on
gluster volume set glustervol1 storage.batch-fsync-delay-usec 0
/etc/glusterfs/glusterd.vol
u konfiguracijski dio (među opcije), dodajte:
option rpc-auth-allow-insecure on
systemctl restart smb.service
systemctl restart nmb.service
systemctl restart glusterd.service
adduser sambauser
smbpasswd –u sambauser
setfacl –m d:u:sambauser:rwx /bricks/brick1/brick
setfacl –m u:sambauser:rwx /bricks/brick1/brick
Konfiguracija je gotova. Pokušajte se sa svojeg Windows klijenta spojiti na vaš gluster share.
Primjera radi, ako ste koristili gluster17.szpp.local koji ima adresu 10.10.7.117, podignite
Windows Explorer i u njemu u adresni prostor napišite:
\\10.10.7.117\gluster-glustervol1