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" 失敗: 超出磁盤限額