2019-01-22

[GlusterFS]SOFTLINK for Common Data

#
root@ns563942_Mail01:/opt/gfs# uname -a
Linux ns563942_Mail01 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

#
root@ns563942_Mail01:/opt/gfs# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"
root@ns563942_Mail01:/opt/gfs#


#
root@ns563942_Mail01:/opt/gfs# cat /proc/cpuinfo | grep Xeon
model name      : Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz
model name      : Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz
model name      : Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz
model name      : Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz
model name      : Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz
model name      : Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz
model name      : Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz
model name      : Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz


#
root@ns563942_Mail01:/opt/gfs# cat /proc/meminfo | grep Total
MemTotal:       32719044 kB
SwapTotal:        523260 kB
VmallocTotal:   34359738367 kB
CmaTotal:              0 kB
HugePages_Total:       0


#
root@ns563942_Mail01:/opt/gfs# fdisk -l|  grep dev/s
Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
/dev/sda1      2048    1048575    1046528  511M EFI System
/dev/sda2   1048576    2095103    1046528  511M Linux filesystem
/dev/sda3   2095104   43053055   40957952 19.5G Linux filesystem
/dev/sda4  43053056   44099583    1046528  511M Linux swap
/dev/sda5  44099584 3907012607 3862913024  1.8T Linux LVM
Disk /dev/sdb: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
/dev/sdb1   2048 3907029134 3907027087  1.8T Linux filesystem
root@ns563942_Mail01:/opt/gfs#


#
root@ns563942_Mail01:/opt/gfs# lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
NAME           FSTYPE       SIZE MOUNTPOINT LABEL
sda                         1.8T           
├─sda1         vfat         511M /boot/efi  EFI_SYSPART
├─sda2         ext4         511M /boot      /boot
├─sda3         ext4        19.5G /          /
├─sda4         swap         511M [SWAP]     swap-sda4
└─sda5         LVM2_member  1.8T           
  ├─vg-lv01var ext4          20G /var       /var
  └─vg-lv02opt ext4         3.6T /opt       /opt
sdb                         1.8T           
└─sdb1         LVM2_member  1.8T           
  └─vg-lv02opt ext4         3.6T /opt       /opt

root@ns563942_Mail01:/opt/gfs#



#GlusterFS 2 node:
#/etc/hosts:
2.2.2.240 gfs01
2.2.2.241 gfs02

#Installation:
apt-get install software-properties-common
add-apt-repository ppa:gluster/glusterfs-4.1
apt-get update
apt-get install glusterfs-server
service glusterd start
service glusterd status
#systemctl | grep gluster

sudo systemctl enable glusterd.service
sudo service glusterd.service start

#Testing on 2 node:
gfs01:
gluster peer probe gfs02
gluster peer status

gfs02:
gluster peer probe gfs01
gluster peer status

#GFS01: Creating new VOLUME. Volumename = "volume1"
#gluster volume create volume1 replica 2 transport tcp gfs01:/opt/.gfserver gfs02:/opt/.gfserver force
gluster volume start volume1
gluster volume info
gluster volume profile volume1 info
gluster volume profile volume1 start
gluster volume profile volume1 info
gluster volume status


#TEST GFS01 + GFS02:
gluster pool list
gluster peer status


#If you want to delete current volume:
gluster volume stop volume1
gluster volume delete volume1

#service glusterd restart






#Cài đặt GLUSTER thành công. Tiến hành MOUNT ổ đĩa để hệ điều hành tự nhận mỗi khi reboot:
#DC1:
#mkdir -p /opt/gfs
#mount -t glusterfs gfs01:/volume1 /opt/gfs
#echo "gfs01:/volume1 /opt/gfs glusterfs defaults 0 0" >> /etc/fstab
#DC2:
#mkdir -p /opt/gfs
#mount -t glusterfs gfs02:/volume1 /opt/gfs
#echo "gfs02:/volume1 /opt/gfs glusterfs defaults 0 0" >> /etc/fstab


#PERFORMANCE TEST:
apt-get install iozone3

IOZONE=/opt/gfs/iozone
mkdir -p $IOZONE
cd $IOZONE
echo "iozone -w -c -e -i 0 -+n -r 64k -s 1024m -t 8 -F f{0,1,2,3,4,5,6,7,8}.ioz"  > network.performance.load.test.sh
chmod +x network.performance.load.test.sh
./network.performance.load.test.sh
#

  




#_________SOFT_LINK:BEGIN
LOC_REAL_STORAGE=/opt/gfs/letsencrypt

LOC_SOFTLINK_STORAGE=/etc
LOC_SOFTLINK_FILENAME=letsencrypt

mkdir -p $LOC_REAL_STORAGE
mkdir -p $LOC_SOFTLINK_STORAGE

ln -s $LOC_REAL_STORAGE $LOC_SOFTLINK_STORAGE/$LOC_SOFTLINK_FILENAME
#
#_________SOFT_LINK:END


#_________SOFT_LINK:BEGIN
LOC_REAL_STORAGE=/opt/gfs/haproxy

LOC_SOFTLINK_STORAGE=/etc
LOC_SOFTLINK_FILENAME=haproxy

mkdir -p $LOC_REAL_STORAGE
mkdir -p $LOC_SOFTLINK_STORAGE

ln -s $LOC_REAL_STORAGE $LOC_SOFTLINK_STORAGE/$LOC_SOFTLINK_FILENAME
#
#_________SOFT_LINK:END


#_________SOFT_LINK:BEGIN
LOC_REAL_STORAGE=/opt/gfs/mailserver

LOC_SOFTLINK_STORAGE=/opt/kerio
LOC_SOFTLINK_FILENAME=mailserver

mkdir -p $LOC_REAL_STORAGE
mkdir -p $LOC_SOFTLINK_STORAGE

ln -s $LOC_REAL_STORAGE $LOC_SOFTLINK_STORAGE/$LOC_SOFTLINK_FILENAME
#
#_________SOFT_LINK:END

No comments:

Post a Comment