Share!

You can easily install GlusterFS via yum as it's readily available in the default yum repository. It could however be a slightly outdated version so you might want to install the newer versions as provided by the CentOS Storage Special Interest Group (SIG).

You can install and configure GlusterFS on CentOS or Red Hat via these steps:

  1. Add latest glusterfs repository to yum (optional).
    $ sudo yum install --assumeyes centos-release-gluster 
    ##### snipped
    ================================================================================
     Package                          Arch      Version             Repository
                                                                               Size
    ================================================================================
    Installing:
     centos-release-gluster5          noarch    1.0-1.el7.centos    extras    4.3 k
    Installing for dependencies:
     centos-release-storage-common    noarch    2-2.el7.centos      extras    5.1 k
    
    Transaction Summary
    ================================================================================
    Install  1 Package (+1 Dependent package)
    ##### snipped

    This will install the CentOS Storage Special Interest Group (SIG) yum repository which provides the latest GlusterFS software packages.

  2. Install glusterfs server and related packages.
    $ sudo yum install --assumeyes glusterfs glusterfs-server
     
    ##### snipped
    =============================================================================================
     Package                       Arch        Version                Repository            Size
    =============================================================================================
    Installing:
     glusterfs                     x86_64      5.3-2.el7              centos-gluster5      668 k
     glusterfs-server              x86_64      5.3-2.el7              centos-gluster5      1.4 M
    Installing for dependencies:
     attr                          x86_64      2.4.46-13.el7          base                  66 k
     glusterfs-api                 x86_64      5.3-2.el7              centos-gluster5      107 k
     glusterfs-cli                 x86_64      5.3-2.el7              centos-gluster5      203 k
     glusterfs-client-xlators      x86_64      5.3-2.el7              centos-gluster5      990 k
     glusterfs-fuse                x86_64      5.3-2.el7              centos-gluster5      147 k
     libtirpc                      x86_64      0.2.4-0.15.el7         base                  89 k
     psmisc                        x86_64      22.20-15.el7           base                 141 k
     rpcbind                       x86_64      0.2.0-47.el7           base                  60 k
     userspace-rcu                 x86_64      0.10.0-3.el7           centos-gluster5       93 k
    
    Transaction Summary
    =============================================================================================
    Install  2 Packages (+9 Dependent packages)
    
    Total download size: 3.9 M
    Installed size: 14 M
    ##### snipped
  3. Configure firewall rules required for glusterd service.
    1. Enable access for glusterfs service.
      $ sudo firewall-cmd --zone=public --add-service=glusterfs --permanent
      success

      This will enable access to 5667/tcp and is similar to running the following command:

      firewall-cmd --zone=public --add-port=5667/tcp --permanent 
    2. Reload firewall to activate changes.
      $ sudo firewall-cmd --reload
      success
  4. Configure automatic startup of glusterd service during boot.
    $ sudo systemctl enable glusterd
    Created symlink from /etc/systemd/system/multi-user.target.wants/glusterd.service to /usr/lib/systemd/system/glusterd.service.
  5. Start glusterd service.
    $ sudo systemctl start glusterd 
  6. Create highly available storage using GlusterFS (optional).