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.
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/brick1Set 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 gluster4Install 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 glusterdsudo dnf install -y centos-release-gluster glusterfs-server glusterfs-cli
sudo systemctl enable --now glusterdOpen 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 reloadsudo firewall-cmd --permanent --add-port=24007-24008/tcp
sudo firewall-cmd --permanent --add-port=49152-49156/tcp
sudo firewall-cmd --reloadFor 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 statusYou 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 appdataConfigure 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 51Client 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/appdataAdd a persistent entry for boot-time mounting.
gluster1:/appdata /mnt/appdata glusterfs defaults,_netdev,backupvolfile-server=gluster2 0 0Install 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-ganeshasudo dnf install -y nfs-ganesha nfs-ganesha-gluster
sudo systemctl enable nfs-ganeshaEXPORT {
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 gluster1On 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-nfsGeo-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 generateCreate 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 statusStatus 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 3Self-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 fullIdentify 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-brainResolve 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-filereplica 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 summaryTune 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 onExport 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 infoFor 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
| Scenario | Recommended layout | Usable capacity |
|---|---|---|
| Fault tolerance, 2-node failure domains | Distributed-replicated, replica 2 | 50% of raw capacity |
| Higher resilience, arbiter tiebreaker | Replica 2 + arbiter 1 | ~50% of raw capacity, arbiter uses minimal disk |
| Maximum throughput, no redundancy | Pure 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 appdataCommon issues
| Symptom | Cause | Fix |
|---|---|---|
| Peer probe fails with rejected state | UUID mismatch or stale /var/lib/glusterd data on a reinstalled node | Stop glusterd, clear /var/lib/glusterd on the affected node, restart and re-probe |
| Volume won't start, brick already in use | Previous brick metadata left on disk from a deleted volume | Run sudo gluster volume start appdata force or clear xattrs with setfattr -x trusted.glusterfs.volume-id |
| Client mount hangs | Quorum lost, fewer than 51% of nodes reachable | Bring enough nodes back online to regain quorum, check gluster peer status |
| Geo-replication status shows Faulty | SSH key not authorized on slave, or slave volume missing | Re-run push-pem and confirm the slave volume exists and is started |
| Split-brain info never clears | Healing files are still open by an application | Close the file handle, then rerun gluster volume heal appdata |
| Permission denied writing to mount | Mount owned by root, app runs as unprivileged user | Set correct ownership with sudo chown appuser:appgroup /mnt/appdata and use 755 on directories, never 777 |
Next steps
- Build a highly available Linux NFS cluster with Pacemaker and DRBD
- Set up RAID arrays with mdadm for performance and redundancy
- Configure GlusterFS volume snapshots and automated retention
- Monitor a GlusterFS cluster with Prometheus and Grafana dashboards