作者:石文
时间:2019-01-07
缩容
Case 1 缩容卷——缩容brick状态offline的volume
卷是分布式复制卷(Distributed-Replicate Volume),副本数为3,对卷进行缩容(缩3台机器的规模)
1.查看卷状态
[root@10-237-44-143 ~]# gluster volume status nfs
Status of volume: nfs
Gluster process TCP Port RDMA Port Online Pid
------------------------------------------------------------------------------
Brick 10.237.44.114:/data0/nfs 49000 0 Y 83263
Brick 10.237.44.17:/data0/nfs 49000 0 Y 134548
Brick 10.237.44.143:/data0/nfs 49000 0 Y 167353
Brick 10.237.44.176:/data0/nfs N/A N/A N N/A
Brick 10.237.44.81:/data0/nfs N/A N/A N N/A
Brick 10.237.44.49:/data0/nfs N/A N/A N N/A
Self-heal Daemon on localhost N/A N/A Y 72026
Self-heal Daemon on 10.237.44.49 N/A N/A Y 169385
Self-heal Daemon on 10.237.44.114 N/A N/A Y 153232
Self-heal Daemon on 10.237.44.176 N/A N/A Y 98954
Self-heal Daemon on 10.237.44.81 N/A N/A Y 166925
Self-heal Daemon on 10.237.44.17 N/A N/A Y 134573
Task Status of Volume nfs
------------------------------------------------------------------------------
There are no active volume tasks
2.因为是3replication,所以缩容只能选择为3的倍数,选择offline状态的brick进行缩容
[root@10-237-44-143 ~]# gluster volume remove-brick nfs 10.237.44.176:/data0/nfs 10.237.44.81:/data0/nfs 10.237.44.49:/data0/nfs force
Remove-brick force will not migrate files from the removed bricks, so they will no longer be available on the volume.
Do you want to continue? (y/n) y
volume remove-brick commit force: success
注意:这里加入了参数,原因是对于offline的birck,必须要使用此参数才能执行缩容操作。
3.检查缩容后卷状态
[root@10-237-44-143 ~]# gluster volume status nfs
Status of volume: nfs
Gluster process TCP Port RDMA Port Online Pid
------------------------------------------------------------------------------
Brick 10.237.44.114:/data0/nfs 49000 0 Y 83263
Brick 10.237.44.17:/data0/nfs 49000 0 Y 134548
Brick 10.237.44.143:/data0/nfs 49000 0 Y 167353
Self-heal Daemon on localhost N/A N/A Y 78018
Self-heal Daemon on 10.237.44.49 N/A N/A Y 185510
Self-heal Daemon on 10.237.44.114 N/A N/A Y 183638
Self-heal Daemon on 10.237.44.176 N/A N/A Y 124963
Self-heal Daemon on 10.237.44.81 N/A N/A Y 90779
Self-heal Daemon on 10.237.44.17 N/A N/A Y 32308
Task Status of Volume nfs
------------------------------------------------------------------------------
There are no active volume tasks
发现卷的Brick减少为3。