Gluster — Directory Quotas

What is Quota?

Dictionary Meaning: 📓

Quota as a feature — Gluster 🐜

Levels

Quota can be set at the following levels:

  • Volume level — it limits the usage at the volume level

Let’s test the feature

Prerequisites

  1. You must have a volume running on a server(s)(either distributed, replicated, or replicated distributed)
  2. You have a glusterfs-client on which you have mounted the volume.

Enable the quota 🔘

To set the disk limits one needs to enable quota. To do so run the following command:

# gluster volume quota <VOLNAME> enable
# gluster volume quota tvol enable
Quota is enabled on /tvol

Disabling Quota 🔴

If you feel you don’t need a limit to be set on the disk and hence wish to disable the quota then run the following command:

# gluster volume quota <VOLNAME> disable
# gluster volume quota tvol disable
Quota translator is disabled on /tvol

Setting or Replacing Disk Limit

You can create new directories and set the disk limits or you can set the disk limit for the existing directories. The directory name should be relative to the volume with the export directory/mount being treated as “/”.

gluster volume quota <VOLNAME> limit-usage <DIR> <HARD_LIMIT>
# gluster volume quota tvol limit-usage /data 10GB Usage limit has been set on /data
[root@servera ~]# mount -t glusterfs servera:tvol /mnt/tvol

Steps: 🚶

  1. Go to your glusterfs-client and create a directory inside the mount-point. Here, we have /mnt/tvol as the mount-point and directory as data.
# cd /mnt/tvol && mkdir data
# gluster volume quota tvol limit-usage /data 10GB 
Usage limit has been set on /data
volume quota : success

😃

Next: Advanced features in Quota

References:

Flutter | Google Actions | Gluster