GlusterFS volume is the disk that is going to be exported to client. it is built on top op of glusterfs cluster.

To create a GlusterFS volume you need a specific folder on all peer nodes for file and metadata storage on all nodes. You'll also need to consider the type of the volume that you want to create. Each volume type provides different level of scalability and performance level and you'll need to choose the one that best fit your requirement.

To build

Steps to create GlusterFS volume:

  1. Allow network access for volume communication from the firewall on all nodes.
    $ sudo firewall-cmd --zone=public --add-port=24009/tcp --permanent && sudo firewall-cmd --reload # CentOS, Fedora, Red Hat
    $ sudo ufw allow 24009 # Ubuntu and Debian variance 
    Rules updated
    Rules updated (v6) # Ubuntu and Debian

    Each volume requires a dedicated port, starting from 24009. If you're to create more than one volume, also allow access to port 24010, 24011 and so on accordingly.

  2. Create directory for our GlusterFS volume on all nodes.
    $ sudo mkdir -p /var/data/gluster/brick

    For the production server, it’s recommended to create the brick or GlusterFS volume on dedicated partition instead of in a system directory.

    XFS is the recommended filesystem type for GlusterFS volume though other filesystem types can still be used.

  3. Create GlusterFS volume from first node.
    $ sudo gluster volume create volume1 replica 2 transport tcp node1:/var/data/gluster/brick node2:/var/data/gluster/brick force
    volume create: volume1: success: please start the volume to access data

    Recommended to use more than 3 nodes to prevent split brain.

  4. Enable the newly created volume from first node.
    $ sudo gluster volume start volume1
    volume start: volume1: success
  5. Verify if the GlusterFS volume was created successfully from first node.
    $ sudo gluster volume info all
    Volume Name: volume1
    Type: Replicate
    Volume ID: 19550419-3495-45d7-bdc6-cab4fa4fb516
    Status: Started
    Snapshot Count: 0
    Number of Bricks: 1 x 2 = 2
    Transport-type: tcp
    Brick1: node1:/var/data/gluster/brick
    Brick2: node2:/var/data/gluster/brick
    Options Reconfigured:
    cluster.granular-entry-heal: on
    storage.fips-mode-rchecksum: on
    transport.address-family: inet
    nfs.disable: on
    performance.client-io-threads: off
Discuss the article:

Comment anonymously. Login not required.