GlusterFS aggregates directories on multiple servers into a single mountable filesystem — useful when you need POSIX semantics across hosts and don’t want the operational weight of Ceph. A distributed volume spreads files across bricks by hashing, which gives you linear capacity scaling but no redundancy; a distributed-replicated volume adds replicas at the cost of doubling storage. This article documents the four-brick install we use as a starting point for small Gluster deployments, the choice between volume types, and the verification steps that catch a split-brain before it eats your evening.
How to verify
# On every peer
apt list --installed glusterfs-server 2>/dev/null
sudo systemctl status glusterd
sudo gluster peer status
# Pool and volume state
sudo gluster pool list
sudo gluster volume list
sudo gluster volume info shared-data
# Heal status (replicated volumes only)
sudo gluster volume heal shared-data info
sudo gluster volume heal shared-data info split-brain
What’s happening
A GlusterFS deployment has three concepts. A peer is a server running glusterd. A brick is a directory on a peer that contributes to a volume — typically a mount point on a dedicated disk or LVM volume, not the root filesystem. A volume is the logical aggregation that clients mount; its type determines how data is laid out across bricks. The common types: distributed (hash-spread, no redundancy), replicated (mirror N copies), distributed-replicated (the practical default — distribute files across replica sets), dispersed (erasure-coded, fewer disks for the same protection but slower writes).
Gluster uses a userspace FUSE client by default. Reads and writes go from the client process through FUSE into the glusterfs userspace daemon, which contacts the right brick based on the file’s hash. There’s no metadata server — every client computes brick locations independently, which is why peer membership and the trusted storage pool need to be consistent across the cluster. When you add or remove bricks, the hash distribution changes and Gluster runs a rebalance operation to move existing files to their new homes; that’s an online operation but it’s bandwidth-heavy.
The failure modes that hurt are split-brain in replicated volumes and stale brick state after a peer reboot. Split-brain happens when two replicas accept divergent writes during a network partition; healing isn’t automatic for files where both sides have changes, and gluster volume heal info split-brain lists files needing manual resolution. The fix is to pick a winner (gluster volume heal <vol> split-brain source-brick <brick> <file>) and let the heal daemon copy from there. Stale brick state happens when the underlying disk reappears with different XFS UUIDs after a kernel update — Gluster keeps brick metadata in extended attributes on the brick path, and if those go missing the brick refuses to start.
The procedure
-
On all four nodes (
storage1throughstorage4), prepare a dedicated XFS-formatted brick volume:sudo mkfs.xfs -i size=512 -f /dev/sdb sudo mkdir -p /data/brick1 echo '/dev/sdb /data/brick1 xfs defaults 0 2' | sudo tee -a /etc/fstab sudo mount /data/brick1 sudo mkdir -p /data/brick1/gv0 -
Install GlusterFS server on all four nodes:
sudo apt update sudo apt install -y glusterfs-server sudo systemctl enable --now glusterd -
Open the management port (24007) and brick ports (49152+) on the firewall:
sudo ufw allow from 10.0.0.0/16 to any port 24007 proto tcp sudo ufw allow from 10.0.0.0/16 to any port 49152:49162 proto tcp -
From
storage1, probe the other peers into the trusted storage pool:sudo gluster peer probe storage2 sudo gluster peer probe storage3 sudo gluster peer probe storage4 sudo gluster peer status -
Create a distributed-replicated volume (replica=2, so 4 bricks = 2 replica sets):
sudo gluster volume create shared-data replica 2 \ storage1:/data/brick1/gv0 storage2:/data/brick1/gv0 \ storage3:/data/brick1/gv0 storage4:/data/brick1/gv0 \ force sudo gluster volume start shared-dataThe
forceflag is needed because the brick paths are subdirectories of the mount; this is the normal pattern, not a workaround. -
Set sane defaults for production:
sudo gluster volume set shared-data performance.cache-size 256MB sudo gluster volume set shared-data network.ping-timeout 10 sudo gluster volume set shared-data cluster.self-heal-daemon enable sudo gluster volume set shared-data cluster.quorum-type auto sudo gluster volume set shared-data cluster.server-quorum-type server -
On a client, install
glusterfs-clientand mount:sudo apt install -y glusterfs-client sudo mkdir -p /mnt/shared sudo mount -t glusterfs storage1:/shared-data /mnt/shared echo "storage1:/shared-data /mnt/shared glusterfs defaults,_netdev,backupvolfile-server=storage2 0 0" | sudo tee -a /etc/fstabThe
backupvolfile-serveroption matters — without it, the client only knows aboutstorage1for the initial fetch of the volume topology and the mount fails on boot if that one peer is down.
Common pitfalls
- Using the root filesystem as a brick (
/datainstead of a dedicated mount) leads to disk-full conditions that wedgeglusterd. Always put bricks on a separate XFS volume. network.ping-timeoutdefaults to 42 seconds, which is too long for most production scenarios — a stuck peer pauses I/O for that interval. Drop to 10s or even 5s for low-latency requirements.- Quorum (
cluster.quorum-type auto) is what keeps split-brain from corrupting writes during a network partition; without it, a 2-replica volume will accept writes on whichever side is reachable and reconcile fights afterward. gluster volume heal infoafter a brick comes back from downtime tells you how much catch-up is in flight; large entries here mean clients will see slow writes until heal finishes.- The FUSE client buffers metadata aggressively; if you
rm -rffrom one client and another client doesn’t see the directory disappear, runfind /mnt/shared/path -deleteinstead or remount.
In the engagements we run, GlusterFS shows up when a customer needs shared POSIX storage across a small number of nodes — typically 3-6 — and doesn’t have the operational maturity for a Ceph deployment. We deploy with quorum, monitor heal counts via the Prometheus exporter, and document the split-brain runbook before the cluster goes live — because the resolution requires picking a winner, and that’s a decision the customer needs to own.