Linux

How to Install GlusterFS on AlmaLinux 9

Installing GlusterFS on AlmaLinux 9 involves a series of steps to set up a scalable network filesystem. This process requires root privileges and access to terminal commands. Here’s a step-by-step guide to help you through the installation:

1. Prepare Your System

Ensure your system is updated and has the necessary development tools:

sudo dnf update -y
sudo dnf groupinstall "Development Tools" -y

2. Add the GlusterFS Repository

GlusterFS packages are available in the CentOS Storage SIG repository, which you can enable on AlmaLinux as follows:

sudo dnf install centos-release-gluster9 -y

3. Install GlusterFS Server

Run the following dnf command to install GlusterFS packages to each server. When prompted, input y to confirm and press ENTER.

sudo dnf install glusterfs glusterfs-libs glusterfs-server

4. Start and Enable GlusterFS Service

sudo systemctl enable glusterfsd.service
sudo systemctl start glusterfsd.service

Then verify the glusterfsd service to ensure that the service is running.

sudo systemctl status glusterfsd.service

5. Verify Installation

Check if GlusterFS is running properly:

sudo systemctl status glusterd

This command should show that the glusterd service is active and running.

6. Configure Firewall

If you have a firewall enabled, you need to allow GlusterFS services through the firewall:

sudo firewall-cmd --zone=public --add-service=glusterfs --permanent
sudo firewall-cmd --reload

7. Configure GlusterFS

Once GlusterFS is installed, you can proceed to configure your storage volumes. This involves setting up storage bricks and creating volumes. Here is a simple example of how to create a replicated volume:

a. Probe Peers

If you have multiple servers, use the gluster peer probe command to connect them:

sudo gluster peer probe

b. Create a Volume

First, create directories that will act as bricks:

sudo mkdir -p /gluster/brick1

Create a replicated volume:

sudo gluster volume create testvol replica 2 transport tcp :/gluster/brick1 :/gluster/brick1 force

c. Start the Volume

Start the volume using:

sudo gluster volume start testvol

8. Install GlusterFS Client (Optional)

To mount GlusterFS volumes on client machines, install the client package:

sudo dnf install glusterfs-client -y

Mount the GlusterFS volume:

sudo mount -t glusterfs :/testvol /mnt

Final Checks

Make sure everything is running smoothly and that volumes are accessible as expected.

By following these steps, you should have a functional GlusterFS setup on your AlmaLinux 9