How to enable GlusterFS volume quotas

A shared GlusterFS volume can run out of usable space before every workload has used its share. Enabling volume quotas turns on quota accounting so directory limits can be added before one path fills the volume for everyone.

GlusterFS enables quotas per volume with the gluster volume quota command. The enable action prepares accounting and exposes the features.quota option, but it does not create a disk limit by itself. A separate limit-usage rule is still required before writes are blocked on a directory path.

Quota accounting can take time to settle on volumes that already contain data, and it adds metadata work while clients write files. Run the change from a trusted-pool node during lower write activity, verify the volume is started first, and treat an empty quota list as expected until a directory limit is configured.

Steps to enable GlusterFS volume quotas:

  1. Open a terminal on a trusted-pool node.
  2. List GlusterFS volumes to confirm the target name.
    $ sudo gluster volume list
    volume1

    Replace volume1 in later commands with the volume to protect.

  3. Confirm the target volume is started.
    $ sudo gluster volume info volume1
    Volume Name: volume1
    Type: Replicate
    Status: Started
    Number of Bricks: 1 x 2 = 2
    Brick1: node1:/srv/gluster/brick1
    Brick2: node2:/srv/gluster/brick1
    ##### snipped #####

    Do not enable quotas as a substitute for starting or repairing a stopped volume; fix the volume state first.

  4. Enable quotas for the volume.
    $ sudo gluster volume quota volume1 enable
    volume quota: success: quota enabled for volume volume1

    Quota accounting can add overhead while initial usage is calculated on existing data.

  5. Verify the quota option is enabled.
    $ sudo gluster volume get volume1 features.quota
    Option                                   Value
    ------                                   -----
    features.quota                           on
  6. List quota entries to confirm the quota subsystem responds.
    $ sudo gluster volume quota volume1 list
    No quota configured

    No quota configured means quota accounting is enabled but no directory hard limit has been set yet.
    Related: How to set GlusterFS quota limits