glusterfs卷--配额功能
配额功能,跟我们常用的磁盘配额一样,主要目的就是为了限制空间使用。
帮助命令:
# gluster help |grep quota
1、开启配额功能
# gluster volume quota v1 enable
volume quota : success
# gluster volume info v1
Volume Name: v1
... ...
Options Reconfigured:
features.quota-deem-statfs: on
features.inode-quota: on
features.quota: on
performance.readdir-ahead: on
performance.stat-prefetch: off
server.allow-insecure: on
2、设置目录的配额
# gluster volume quota v1 limit-usage /aa 100MB #/aa 指的是挂载点下面的目录
volume quota : success
3、查看目录的配额信息
# gluster volume quota v1 list
Path Hard-limit Soft-limit Used Available Soft-limit exceeded? Hard-limit exceeded?
----------------------------------------------------------------------------------------------------------
/aa 100.0MB 80%(80.0MB) 0Bytes 100.0MB No No
4、客户端--测试配额限制
# dd if=/dev/zero of=file1 bs=1M count=70
# dd if=/dev/zero of=file2 bs=1M count=30
# gluster volume quota v1 list
Path Hard-limit Soft-limit Used Available Soft-limit exceeded? Hard-limit exceeded?
------------------------------------------------------------------------------------------------------------------------------
/aa 100.0MB 80%(80.0MB) 100.0MB 0Bytes Yes Yes
注意:我这里的glusterfs环境配置低反应慢,现在马上写入超额文件是可以的,等一会儿再写就不能写了
等了N久之后
# dd if=/dev/zero of=file3 bs=1M count=1
dd: 打开"file3" 失败: 超出磁盘限额