About lvs + ftp + GlusterFS file server high-availability deployment

Firewall> LVS> the FTP 2> glueterfs 2

  • lvs DR mode using ftp load tcp port
  • ftp mount the duplex copy storage GlusterFS
  • Environmental host 2 lvs, 2 sets ftp + GlusterFS

lvs configuration

Specific configuration refer to my blog - "Production LVS load balancing and high availability keepalive practice" https://attacker.club/detail/122.html

Referring to operation mode using the command line on the host lvs

ipvsadm -C # 清理策略
ipvsadm -A -t 10.0.1.15:21 -s rr -p
ipvsadm -a -t 10.0.1.15:21 -r 10.0.1.16:21 -g
ipvsadm -a -t 10.0.1.15:21 -r 10.0.1.17:21 -g

Back-end host ports plus vip loop

vip=10.0.1.15
#把vip绑定在lo上,是为了实现rs直接把结果返回给客户端
ifconfig lo:0 $vip broadcast $vip netmask 255.255.255.255 up
route add -host $vip lo:0
#以下操作为更改arp内核参数,目的是为了让rs顺利发送mac地址给客户端
echo "1" >/proc/sys/net/ipv4/conf/lo/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/lo/arp_announce
echo "1" >/proc/sys/net/ipv4/conf/all/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/all/arp_announce

GlusterFS replicated volumes

GlusterFS storage directory

mkdir  /home/gfs
# 创建一个存储文件夹目录(一般会有数据盘挂载使用)

/etc/hosts

10.0.1.31 gfsnode-1
10.0.1.32 gfsnode-2
yum -y install centos-release-gluster
yum -y install glusterfs glusterfs-fuse glusterfs-server
#yum 安装

glusterfs  -V
# 查看版本

systemctl enable glusterd
systemctl start glusterd

Any node

gluster peer probe gfsnode-1
gluster peer probe gfsnode-2

gluster peer status
# 显示除自己的其他全部节点

mkdir -p /home/gfs/storage # 创建存储目录
gluster volume create rep_vol replica 2 gfsnode-1:/home/gfs/storage gfsnode-2:/home/gfs/storage # 创建类型为复制卷的存储

gluster volume start  rep_vol
# 启动复制卷

gluster volume status
gluster volume info
# 状态查看

ftp related deployment

bash vsftpd_install.sh

ftp mount storage

mount -t glusterfs  gfsnode-1:rep_vol  /home/repo/gfs_data/
# ftp1

mount -t glusterfs  gfsnode-2:rep_vol  /home/repo/gfs_data/
# ftp2

ps: modify and add new files mounted gfs_data operating, data can be synchronized; not to be confused with the / home / gfs / storage storage directory

Reproduced in: https: //my.oschina.net/attacker/blog/3057877

Guess you like

Origin blog.csdn.net/weixin_34032779/article/details/91935883