##################gfs#######################################
挂载点data
xenserver 10.0.3.223 10.0.3.224 ,在3.42 和3.43 服务器 上各添加一块盘
mkfs.xfs /dev/xvdi
mkdir /data/data-ssp
echo "/dev/xvdi /data/data-ssp xfs defaults 0 0 ">>/etc/fstab
mount -a
########安装服务###
yum install centos-release-gluster -y
yum -y install glusterfs-server glusterfs-fuse rpcbind
systemctl start rpcbind
systemctl enable rpcbind
systemctl start glusterd
systemctl enable glusterd
######配置hosts
vim /etc/hosts
10.0.8.42 gfs3.ui.cm2
10.0.8.43 gfs4.ui.cm2
######测试hosts是否成功,并添加节点
gluster peer probe gfs3.ui.cm2
gluster peer probe gfs4.ui.cm2
###如果删除,用下面命令
gluster peer detach node2
3.43上操作,建立一个gfs共享目录,会自动同步到3.42上
cd /data/data-ssp
mkdir ssp
gluster volume create GFS-data-ssp replica 2 10.0.3.43:/data/data-ssp/ssp 10.0.3.42:/data/data-ssp/ssp
gluster volume start GFS-data-ssp
客户端上操作
yum -y install glusterfs glusterfs-fuse
mount -t glusterfs 10.0.3.42:GFS-data-ssp /home/ads/ftp/ssp_bid
echo "10.0.3.42:GFS-data-hermers /tmp/hermers/signflag glusterfs defaults 0 0" >> /etc/fstab
###查看信息
gluster volume info
gluster peer status
####删除卷
gluster volume delete GFS-data-ssp
gluster volume create GFS-plat replica 2 10.2.3.43:/data/plat/yoyi-plat 10.2.3.42:/data/plat/yoyi-plat
gluster volume create GFS-data-zeus replica 2 10.2.3.43:/data/data/zeus 10.2.3.42:/data/data/zeus
mount -t glusterfs 10.0.3.42:GFS-data-ssp /GFS3
mount -t glusterfs 10.2.3.42:GFS-data-ssp /GFS4
rsync -avp /GFS1/ /GFS2/
rsync -avp /GFS3/ /GFS4/
gluster volume create GFS-data-zeus replica 2 10.2.3.43:/data/data-zeus/zeus 10.2.3.42:/data/data-zeus/zeus
### gfs 扩容###
注:当你给分布式复制卷和分布式条带卷中增加bricks时,你增加的bricks的数目必须是复制或者条带数目的倍数,
例如:你给一个分布式复制卷的replica为2,你在增加bricks的时候数量必须为2、4、6、8等
准备2块大小一样硬盘,挂载
扩容:gluster volume add-brick td-data replica 2 10.2.3.40:/data/sdf/td_data 10.2.3.41:/data/sdf/td_data
查询:[root@gfs01-plat-td ~]# gluster volume info td-data
Volume Name: td-data
Type: Distributed-Replicate
Volume ID: 7b84ae24-c6c7-4179-aa12-651c7d6a51e6
Status: Started
Snapshot Count: 0
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: 10.2.3.40:/data/sdb/td_data
Brick2: 10.2.3.41:/data/sdb/td_data
Brick3: 10.2.3.40:/data/sdf/td_data
Brick4: 10.2.3.41:/data/sdf/td_data
Options Reconfigured:
transport.address-family: inet
storage.fips-mode-rchecksum: on
nfs.disable: on
performance.client-io-threads: off
扩容成功后,开始做磁盘负载
gluster volume rebalance td-data start