Build a multi-node GlusterFS distributed storage cluster with replication and geo-replication

Advanced 95 min Nov 29, 2026 15 views
Ubuntu 24.04 Debian 12 AlmaLinux 9 Rocky Linux 9

Deploy a production GlusterFS trusted storage pool across multiple nodes with replicated and distributed-replicated volumes, FUSE and NFS-Ganesha client access, geo-replication for disaster recovery, and self-healing quorum settings.

Prerequisites

  • At least 4 Linux servers with dedicated block storage devices
  • Root or sudo access on all nodes
  • Low-latency network connectivity between nodes (1Gbps or higher recommended)
  • A separate remote datacenter or site for geo-replication
  • Basic familiarity with Linux filesystems and systemd

What this solves

GlusterFS is a scale-out network filesystem that pools storage bricks from multiple servers into a single namespace. This tutorial builds a four-node trusted storage pool, creates distributed-replicated volumes for fault tolerance, configures client mounts over FUSE and NFS-Ganesha, sets up geo-replication to a remote datacenter, and covers self-healing, split-brain resolution, and quorum tuning for production use.

Warning: GlusterFS requires at least an even number of bricks per replica set for replicated volumes, and distinct physical disks or partitions per brick. Do not use loopback files or the OS root partition in production.

Step-by-step installation

Prepare storage bricks on every node

Each of the four nodes (gluster1 through gluster4) needs a dedicated block device formatted with XFS, which is the recommended filesystem for GlusterFS bricks due to its extended attribute support.

sudo mkfs.xfs -i size=512 /dev/sdb
sudo mkdir -p /data/brick1
echo '/dev/sdb /data/brick1 xfs defaults 0 0' | sudo tee -a /etc/fstab
sudo mount -a
df -h /data/brick1

Set hostnames and hosts file on all nodes

GlusterFS resolves peers by hostname, so consistent name resolution across all four nodes is required before pool formation.

203.0.113.10 gluster1
203.0.113.11 gluster2
203.0.113.12 gluster3
203.0.113.13 gluster4

Install GlusterFS server packages

Install the server and client packages on every node in the pool.

sudo apt update
sudo apt install -y glusterfs-server glusterfs-client
sudo systemctl enable --now glusterd
sudo dnf install -y centos-release-gluster glusterfs-server glusterfs-cli
sudo systemctl enable --now glusterd

Open firewall ports for cluster traffic

GlusterFS needs port 24007 for the management daemon, 24008 for inter-node RDMA, and a range starting at 49152 per brick. Open only the required ports with specific rules rather than disabling the firewall.

sudo ufw allow from 203.0.113.0/24 to any port 24007:24008 proto tcp
sudo ufw allow from 203.0.113.0/24 to any port 49152:49156 proto tcp
sudo ufw reload
sudo firewall-cmd --permanent --add-port=24007-24008/tcp
sudo firewall-cmd --permanent --add-port=49152-49156/tcp
sudo firewall-cmd --reload

For more granular network-level rules, see implementing network security policies with iptables and firewalld.

Form the trusted storage pool

Run peer probe from gluster1 to add the other three nodes. Peers are added once, and the pool state propagates automatically.

sudo gluster peer probe gluster2
sudo gluster peer probe gluster3
sudo gluster peer probe gluster4
sudo gluster peer status

You should see all three peers in state Peer in Cluster. Confirm basic system identity across nodes with uname and hostnamectl if hostnames look inconsistent.

Create a distributed-replicated volume

This layout distributes data across two replica pairs, giving both capacity scaling and fault tolerance. Each replica set tolerates one node failure without data loss.

sudo gluster volume create appdata replica 2 \
  gluster1:/data/brick1/appdata \
  gluster2:/data/brick1/appdata \
  gluster3:/data/brick1/appdata \
  gluster4:/data/brick1/appdata \
  force
sudo gluster volume start appdata
sudo gluster volume info appdata
Note: brick order matters. Gluster pairs bricks sequentially into replica sets, so brick 1 and 2 form the first replica pair, brick 3 and 4 form the second.

Configure quorum to prevent split-brain

Server-side quorum stops bricks from accepting writes when a majority of nodes is unreachable, which is the main defense against split-brain in replicated volumes.

sudo gluster volume set appdata cluster.quorum-type auto
sudo gluster volume set appdata cluster.server-quorum-type server
sudo gluster volume set appdata cluster.server-quorum-ratio 51

Client mount configuration

Mount with the native FUSE client

FUSE is the recommended client for most workloads because it understands replication and automatically retries against surviving bricks.

sudo apt install -y glusterfs-client
sudo mkdir -p /mnt/appdata
sudo mount -t glusterfs gluster1:/appdata /mnt/appdata
df -h /mnt/appdata

Add a persistent entry for boot-time mounting.

gluster1:/appdata /mnt/appdata glusterfs defaults,_netdev,backupvolfile-server=gluster2 0 0

Install and configure NFS-Ganesha for NFSv4 access

NFS-Ganesha is useful for clients that cannot run the FUSE module, such as VMware datastores or legacy appliances.

sudo apt install -y nfs-ganesha nfs-ganesha-gluster
sudo systemctl enable nfs-ganesha
sudo dnf install -y nfs-ganesha nfs-ganesha-gluster
sudo systemctl enable nfs-ganesha
EXPORT {
  Export_Id = 1;
  Path = "/appdata";
  Pseudo = "/appdata";
  Access_Type = RW;
  Squash = No_root_squash;
  Protocols = 4;
  Transports = TCP;
  SecType = sys;
  FSAL {
    Name = GLUSTER;
    Hostname = "gluster1";
    Volume = "appdata";
  }
}
sudo systemctl restart nfs-ganesha
showmount -e gluster1

On the NFS client, mount with the standard NFSv4 client, pointing at any node's address since Ganesha fronts the Gluster volume.

sudo mount -t nfs4 -o minorversion=1 gluster1:/appdata /mnt/appdata-nfs

Geo-replication for disaster recovery

Set up SSH trust from master to slave cluster

Geo-replication pushes changes asynchronously from a master volume to a slave volume in a separate datacenter, using SSH as the transport. Generate a dedicated key pair on the master's first node.

sudo ssh-keygen -t ed25519 -f /var/lib/glusterd/geo-replication/secret.pem -N ''
sudo gluster-georep-sshkey generate

Create and start the geo-replication session

The slave volume (dr-appdata) must already exist on the remote cluster before the session is created. Use the gluster push-pem helper to distribute keys and authorize access automatically.

sudo gluster volume geo-replication appdata gluster-dr1::dr-appdata create push-pem
sudo gluster volume geo-replication appdata gluster-dr1::dr-appdata start
sudo gluster volume geo-replication appdata gluster-dr1::dr-appdata status

Status should show Active for the worker and Changelog Crawl as the crawl status once initial synchronization completes. For a broader cross-region DR pattern using object storage instead, compare with S3-compatible disaster recovery with MinIO cross-region replication.

Tune geo-replication checkpoints and bandwidth

Set a checkpoint label to measure recovery point objectives, and throttle bandwidth so replication does not saturate the WAN link during business hours.

sudo gluster volume geo-replication appdata gluster-dr1::dr-appdata config checkpoint now
sudo gluster volume geo-replication appdata gluster-dr1::dr-appdata config sync-jobs 3

Self-healing and split-brain resolution

Enable and tune the self-heal daemon

The self-heal daemon runs on every node and reconciles differences between replica bricks after a node rejoins the pool.

sudo gluster volume set appdata cluster.self-heal-daemon on
sudo gluster volume set appdata cluster.heal-timeout 600
sudo gluster volume heal appdata full

Identify and resolve split-brain files

Split-brain occurs when conflicting writes happen on both replicas of a file while they cannot communicate, and Gluster cannot automatically decide which copy is correct.

sudo gluster volume heal appdata info split-brain

Resolve using the larger file, latest mtime, or a specific brick as the source of truth, depending on your data semantics.

sudo gluster volume heal appdata split-brain latest-mtime /path/to/conflicted-file
sudo gluster volume heal appdata split-brain source-brick gluster1:/data/brick1/appdata /path/to/conflicted-file
Note: arbiter bricks (a third, metadata-only brick in each replica set) prevent most split-brain scenarios by acting as a tiebreaker. Consider replica 2 arbiter 1 for new volumes instead of plain replica 2.

Monitoring and performance tuning

Check volume and brick health

Run these commands regularly, or wire them into a monitoring check, to catch brick failures and heal backlogs early.

sudo gluster volume status appdata detail
sudo gluster volume heal appdata info summary

Tune performance translators

Client-side caching and read-ahead settings reduce latency for small-file and metadata-heavy workloads such as web content or container image storage.

sudo gluster volume set appdata performance.cache-size 1GB
sudo gluster volume set appdata performance.io-thread-count 32
sudo gluster volume set appdata performance.client-io-threads on

Export metrics to Prometheus

GlusterFS exposes volume-level metrics through gluster volume profile, which can be scraped with a textfile collector for Prometheus node_exporter, or correlated with disk-level stats.

sudo gluster volume profile appdata start
sudo gluster volume profile appdata info

For a full dashboarding setup, reuse the patterns from setting up Prometheus and Grafana with Docker Compose, pointing a custom exporter at the profile output.

Capacity planning

ScenarioRecommended layoutUsable capacity
Fault tolerance, 2-node failure domainsDistributed-replicated, replica 250% of raw capacity
Higher resilience, arbiter tiebreakerReplica 2 + arbiter 1~50% of raw capacity, arbiter uses minimal disk
Maximum throughput, no redundancyPure distributed~95% of raw capacity

Verify your setup

sudo gluster peer status
sudo gluster volume info appdata
sudo gluster volume status appdata
sudo gluster volume geo-replication status
mount | grep appdata

Common issues

SymptomCauseFix
Peer probe fails with rejected stateUUID mismatch or stale /var/lib/glusterd data on a reinstalled nodeStop glusterd, clear /var/lib/glusterd on the affected node, restart and re-probe
Volume won't start, brick already in usePrevious brick metadata left on disk from a deleted volumeRun sudo gluster volume start appdata force or clear xattrs with setfattr -x trusted.glusterfs.volume-id
Client mount hangsQuorum lost, fewer than 51% of nodes reachableBring enough nodes back online to regain quorum, check gluster peer status
Geo-replication status shows FaultySSH key not authorized on slave, or slave volume missingRe-run push-pem and confirm the slave volume exists and is started
Split-brain info never clearsHealing files are still open by an applicationClose the file handle, then rerun gluster volume heal appdata
Permission denied writing to mountMount owned by root, app runs as unprivileged userSet correct ownership with sudo chown appuser:appgroup /mnt/appdata and use 755 on directories, never 777
Never use chmod 777. It gives every local and remote user full read, write and execute access to shared cluster storage. Fix ownership with chown to the application's actual user and group, and use 755 for directories or 644 for files instead.

Next steps

Running this in production?

Want this handled for you? Running this at scale adds a second layer of work: capacity planning, failover drills, cost control, and on-call for split-brain incidents at 3am. See how we run infrastructure like this for European teams.
#glusterfs #distributed storage #replication #geo-replication #self-healing #split-brain #high availability #storage cluster

Don't want to manage this yourself?

We handle infrastructure for businesses that depend on uptime. Fully managed, with one fixed contact who knows your setup.

You get one fixed contact who knows your setup

Rotterdam 04:47 · reachable in a message, no ticket form

Learn more: managed cloud infrastructure