Back to articles
AI & Cloud

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...

DPTCloud Engineering4 min read
Complete Guide to Configuring GlusterFS: High-Performance Shared Storage Between VPS in a Virtual LAN

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:

  1. 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
  1. 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
  1. 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 status to check volume health and df -h to 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-size to improve access speed.
  • Use transport tcp unless 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

DPTCloud Tier III Infrastructure

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.

View 22 VPS Plans
ECO · vn-02Recommended

VPS-4E

297.000 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe
ECO · vn-02

VPS-5E

614.900 ₫ / mo

10% VAT included

  • CPU: 8 vCPU
  • RAM: 16 GB
  • SSD: 100 GB NVMe
ADVANCED · vn-03Recommended

VPS-4T

548.900 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478