Centos7安装glusterfs

centos7 & glusterfs

服务端

yum install centos-release-gluster

yum install -y glusterfs glusterfs-server glusterfs-fuse glusterfs-rdma

systemctl start glusterd.service

systemctl enable glusterd.service

fdisk, mkfs.xfs ...

firewall-cmd --permanent --add-service=glusterfs firewall-cmd --reload

gluster peer probe 192.168.3.xxx

mkdir -p /data/brick1/gv0 mkdir -p /data/brick2/gv1

gluster volume create gv0 replica 2 192.168.3.223:/data/brick1/gv0 192.168.3.224:/data/brick1/gv0 gluster volume start gv0 gluster volume info

ls -lA /data/brick1/gv0

mount安全:

gluster volume set gv02 auth.allow 192.168.3.233

客户端

yum install centos-release-gluster yum install glusterfs glusterfs-fuse attr -y

/etc/fstab

192.168.3.223:/gv01 /mnt/glusterfsdata glusterfs defaults,_netdev 0 0

mount -t glusterfs 192.168.3.223:/gv01 /mnt/glusterfsdata

glusterfs 维护 扩容缩减

扩容:

gluster volume add-brick gv01 192.168.3.223:/data/brick2/gv01

gluster volume add-brick gv01 192.168.3.224:/data/brick2/gv01

gluster volume rebalance gv01 start

1)lazy:每次仅可以迁移一个文件

2)normal:默认设置,每次迁移2个文件或者是(CPU逻辑个数-4)/2,哪个大,选哪个

3)aggressive:每次迁移4个文件或者是(CPU逻辑个数-4)/2

gluster volume set gv01 cluster.rebal-throttle lazy

缩减:

gluster volume remove-brick gv01 192.168.3.223:/data/brick2/gv01 start

gluster volume remove-brick gv01 192.168.3.223:/data/brick2/gv01 status

gluster volume remove-brick gv01 192.168.3.223:/data/brick2/gv01 commit