📂 Part 5: Distributed Storage with GlusterFS on Debian 13 (Trixie)
Welcome to the fifth and final installment of our "Debian 13 Clustering & Distribution" series. In the previous guide, we deployed a self-healing PostgreSQL cluster. Now, we will establish a highly available, active-active distributed file storage system for telephony media assets (such as call recordings, voicemail logs, and system music). In this tutorial, we will configure GlusterFS (Replica 3) on Debian 13, build a trusted storage pool, create replication volumes, and configure target clients with automatic failover mounts.🏗️ Why Use Distributed Storage?
In a multi-server PBX deployment, sharing files over a single server via standard NFS creates a Single Point of Failure (SPOF) and a severe I/O bottleneck.
A distributed file system like GlusterFS solves this by offering:
- Redundancy (Replica 3): Media files are written simultaneously to three nodes. If a storage node goes offline, files remain fully accessible.
- Active-Active Access: Client nodes (like FreeSWITCH application servers) can read and write to any storage node in the pool.
- Self-Healing: If a failed node is restored, GlusterFS automatically synchronizes missing block differences.
🏛️ Storage Cluster Architecture
Our cluster will use 3 dedicated storage nodes to run a split-brain safe Replica 3 volume.
| Role | Hostname | IP | Function |
|---|---|---|---|
| File Server 1 | fs-node-01 | 192.168.10.34 | GlusterFS Brick Node 1 |
| File Server 2 | fs-node-02 | 192.168.10.35 | GlusterFS Brick Node 2 |
| File Server 3 | fs-node-03 | 192.168.10.36 | GlusterFS Brick Node 3 |
🛠️ Step 1: Environment Preparation (All 3 Storage Nodes)
Log into each storage node to perform the base installation.
1.1 Configure Hostnames
Assign hostnames to distinguish nodes:
1.2 Resolution IP Mappings (/etc/hosts)
Add this mapping block to /etc/hosts on all nodes (including your VoIP/FreeSWITCH clients):
1.3 Install GlusterFS Daemon
Debian 13 includes GlusterFS Server in its native repositories. Run the following command on all storage nodes:
1.4 Firewall Configuration (nftables)
GlusterFS dynamically maps ports, but the main broker daemon listens on port 24007. To ensure simple and secure communications, allow total access between storage cluster nodes, and restrict client mount traffic.
Add these rules to /etc/nftables.conf on all 3 nodes:
🤝 Step 2: Establish the Trusted Storage Pool
Next, we link our cluster nodes together. Run these peer commands from fs-node-01 ONLY:
Verify that both nodes are successfully connected:
Expected Output:🧱 Step 3: Create the Distributed Volume
With our storage pool established, we define a replicated volume named gv_recordings.
3.1 Create Brick Directories (All 3 Nodes)
Create a directory path where GlusterFS will write block files:
/dev/sdb), format it with an XFS filesystem, and mount it to your brick path to guarantee I/O isolation.3.2 Initialize the Volume (fs-node-01 only)
Define the replicated volume structure:
(We use theforce flag here because we are writing to the root filesystem block loop).
3.3 Start the Replicated Volume
Verify that the volume is started:
🔌 Step 4: Client Configuration (Mounting & High Availability)
To access the distributed storage pool, telephony and application servers must mount the gv_recordings volume locally.
4.1 Install the Native FUSE Client
Run the following command on all client servers (such as FreeSWITCH or API nodes):
4.2 Create Target Mount Point
Create the directories matching FreeSWITCH's expected layout:
4.3 Configure Automount in /etc/fstab with Failover
To ensure the storage mount survives server restarts and automatically handles node failures, configure the /etc/fstab table using the backup-volfile-servers flag.
If the primary node fs-node-01 goes offline, the client will immediately switch to fs-node-02 or fs-node-03 to keep reads/writes alive without interrupting calls:
4.4 Mount and Verify
Trigger the mounting process and inspect the active storage size:
4.5 Alternative: NAS / NFS Mount Option
If your organization prefers using a pre-existing physical NAS appliance instead of building a software cluster, configure NFS client mounting on your nodes:
🔄 Step 5: Advanced Operations & Health Checks
Self-Healing Synchronization
If a storage node crashes and is later restored, the cluster repairs block differences automatically in the background. To monitor progress, run:
If the output displays 0 entries, your distributed data is fully synchronized.
🏁 Series Wrap-Up
Congratulations! You have completed the Debian 13 Clustering & Distribution guide series.
We have successfully covered:
- Part 1: Setting up a secure, signed public APT repository.
- Part 2: Compiling and packaging FreeSWITCH from source.
- Part 3: Packaging Kamailio and deploying it securely.
- Part 4: Implementing a self-healing PostgreSQL cluster using Patroni and Etcd consensus.
- Part 5: Building a replicated storage layer using GlusterFS for media file distribution.
Your infrastructure is now secure, modular, highly available, and ready for enterprise scale.