CentOS 8
Sponsored Link

GlusterFS 8 : クォータを設定する2020/12/01

 
クォータを設定すると、特定のボリュームやボリューム内のディレクトリーに対して、使用可能な容量を制限をすることができます。
[1] 任意の GlusterFS ボリューム構成ノードでクォータを有効にします。
[root@node01 ~]#
gluster volume quota vol_distributed enable

volume quota : success
[root@node01 ~]#
gluster volume info

Volume Name: vol_distributed
Type: Distribute
Volume ID: 19c1760d-ea06-4ba7-b6ea-ef33d7a1f64b
Status: Started
Snapshot Count: 0
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: node01:/glusterfs/distributed
Brick2: node02:/glusterfs/distributed
Options Reconfigured:
features.quota-deem-statfs: on
features.inode-quota: on
features.quota: on
storage.fips-mode-rchecksum: on
transport.address-family: inet
nfs.disable: on

# 無効化する場合は以下

[root@node01 ~]#
gluster volume quota vol_distributed disable

[2] ボリューム全体にクォータを設定する場合は以下のように実行します。
# 例として [vol_distributed] ボリューム全体に 1GB のクォータを設定

# gluster volume quota [volume name] limit-usage [path of target directory] [hard_limit]

[root@node01 ~]#
gluster volume quota vol_distributed limit-usage / 1GB

volume quota : success
[root@node01 ~]#
gluster volume quota vol_distributed list

                  Path                   Hard-limit  Soft-limit      Used  Available  Soft-limit exceeded? Hard-limit exceeded?
-------------------------------------------------------------------------------------------------------------------------------
/                                          1.0GB     80%(819.2MB)  908.0MB 116.0MB             Yes                   No

# クライアントからは設定されたクォータ容量がファイルシステム全体の容量として表示される

[root@client ~]#
df -h

Filesystem                         Size  Used Avail Use% Mounted on
node01.srv.world:/vol_distributed  1.0G  908M  116M  89% /mnt

# もし、クライアントからもクォータ容量ではなく実際の全体用量を表示したい場合は

# 任意の GlusterFS ボリューム構成ノード上で [quota-deem-statfs] パラメーターをオフにする

[root@node01 ~]#
gluster volume set vol_distributed quota-deem-statfs off

[3] ボリューム配下のディレクトリーに対してクォータを設定する場合は以下のように実行します。
# 例として [vol_distributed] ボリューム配下の [/dir01] に 1GB のクォータを設定

[root@node01 ~]#
gluster volume quota vol_distributed limit-usage /dir01 1GB

volume quota : success
[root@node01 ~]#
gluster volume quota vol_distributed list

                  Path                   Hard-limit  Soft-limit      Used  Available  Soft-limit exceeded? Hard-limit exceeded?
-------------------------------------------------------------------------------------------------------------------------------
/dir01                                     1.0GB     80%(819.2MB)   0Bytes   1.0GB              No                   No

# クライアントからは設定されたクォータ容量がディレクトリー全体の容量として表示される

[root@client ~]#
df -h /mnt/dir01

Filesystem                         Size  Used Avail Use% Mounted on
node01.srv.world:/vol_distributed  1.0G     0  1.0G   0% /mnt
[4] ソフトリミットを個別に設定する場合は以下のように実行します。
# 例として [vol_distributed] ボリューム配下の [/dir01] に 1GB のクォータを設定し、ソフトリミットに 70% を設定

# gluster volume quota [volume name] limit-usage [path of target directory] [hard_limit] [soft_limit]

[root@node01 ~]#
gluster volume quota vol_distributed limit-usage /dir01 1GB 70

volume quota : success
[root@node01 ~]#
gluster volume quota vol_distributed list

                  Path                   Hard-limit  Soft-limit      Used  Available  Soft-limit exceeded? Hard-limit exceeded?
-------------------------------------------------------------------------------------------------------------------------------
/dir01                                     1.0GB     70%(716.8MB)   0Bytes   1.0GB              No                   No
[5] 設定したクォータを削除する場合は以下のように実行します。
# 例として [vol_distributed] ボリューム全体に設定したクォータを削除

[root@node01 ~]#
gluster volume quota vol_distributed remove /

volume quota : success
[root@node01 ~]#
gluster volume quota vol_distributed list

quota: No quota configured on volume vol_distributed
関連コンテンツ