Complete Guide to Configuring GlusterFS: High-Performance Shared Storage Between VPS in a Virtual LAN
A detailed guide to configuring GlusterFS for high-performance shared storage between VPS in a virtual LAN, optimizing scalability and data reliability for AI applications and...
Introduction to GlusterFS and Shared Storage Solutions
GlusterFS is an open-source distributed storage system that enables the creation of high-performance shared storage across multiple servers, including VPS instances within a virtual LAN. With linear scalability, high reliability, and strong fault tolerance, GlusterFS is ideal for AI applications, self-hosted services, and systems requiring simultaneous data access from multiple nodes.
In a VPS environment, GlusterFS addresses limitations of local storage and improves data availability. Instead of each VPS having isolated storage, GlusterFS allows all VPS instances in the virtual LAN to access a unified storage pool. It also provides data replication, distribution, and automatic recovery in case of node failure.
Prerequisites and Pre-Configuration Setup
To successfully configure GlusterFS, ensure the following requirements are met:
- Hardware: At least two VPS instances with stable, high-speed network connectivity.
- Operating System: Linux (Ubuntu 22.04 or CentOS 8 and later).
- Software: GlusterFS server and client packages installed on all VPS instances.
- Network: All VPS instances must reside within the same virtual LAN and be accessible via internal IP addresses.
- Admin Privileges: Root or sudo access on all VPS instances.
Step-by-Step GlusterFS Configuration on VPS Instances
Follow these steps to configure GlusterFS:
- Install GlusterFS: On each VPS, run the following commands to install GlusterFS:
sudo apt update
sudo apt install glusterfs-server -y
Start and enable the GlusterFS daemon:
sudo systemctl start glusterd
sudo systemctl enable glusterd
- Create GlusterFS Cluster: On the first VPS (named "server-1"), add the remaining VPS instances to the cluster:
sudo gluster peer probe server-2
sudo gluster peer probe server-3
Verify peer connections on each node:
sudo gluster peer status
- Create Shared Volume: On the first VPS, create a shared volume:
sudo gluster volume create shared-storage replica 2 transport tcp server-1:/data server-2:/data
sudo gluster volume start shared-storage
The replica 2 option enables data mirroring between two nodes, enhancing availability and reliability.
Verification and Performance Testing
After configuration, verify the shared storage setup:
- Mount the Volume: On each VPS, mount the volume to a desired directory:
sudo mount -t glusterfs server-1:shared-storage /mnt/shared
- Test Read/Write Operations: Create a test file to verify concurrent access:
echo "Test data" > /mnt/shared/test.txt
cat /mnt/shared/test.txt
- Monitor Performance: Use
gluster volume statusto check volume health anddf -hto view used storage.
Troubleshooting and Performance Optimization
Common GlusterFS configuration issues include:
- Connection Failures Between VPS: Verify firewall rules and ensure ports 24007–24009 are open.
- Volume Not Starting: Check logs in
/var/log/glusterfs/for errors. - Low Performance: Optimize by increasing block size or using SSD storage.
For performance tuning:
- Set
performance.cache-sizeto improve access speed. - Use
transport tcpunless RDMA hardware is available.
For more details, refer to the official documentation at https://gluster.readthedocs.io/en/latest/.
Related infrastructure & engineering guides: High-RAM Cloud VPS for Self-Hosted LLMs & API Gateways · Complete Guide to Installing and Optimizing Open WebUI as a Multi-Channel AI Customer Support Desk on VPS
High-RAM Cloud VPS Plans Optimized for AI, Databases & Cache
Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.
VPS-4E
10% VAT included
- CPU: 4 vCPU
- RAM: 8 GB
- SSD: 50 GB NVMe
