Skip to content

Latest commit

Β 

History

History
112 lines (87 loc) Β· 2.88 KB

File metadata and controls

112 lines (87 loc) Β· 2.88 KB

Multi-Machine Setup Examples

Example 1: 3-Machine Cluster

Scenario

You have 3 machines and want to sync folders between all of them:

  • Machine A: 192.168.1.10 β†’ /home/user/documents
  • Machine B: 192.168.1.20 β†’ /opt/shared-data
  • Machine C: 192.168.1.30 β†’ /tmp/sync-folder

Setup Process

Run on ALL machines (same IP list everywhere):

./gluster-sync setup

When prompted for IPs, provide ALL machine IPs:

Option 1 - Bulk Entry (Recommended):

All peer IPs (comma-separated): 192.168.1.10,192.168.1.20,192.168.1.30
βœ… Added node: 192.168.1.10
βœ… Added node: 192.168.1.20  
βœ… Added node: 192.168.1.30
πŸ“‹ Cluster nodes: 192.168.1.10, 192.168.1.20, 192.168.1.30

Option 2 - Individual Entry:

Node IP [1]: 192.168.1.10
βœ… Added node: 192.168.1.10
Node IP [2]: 192.168.1.20
βœ… Added node: 192.168.1.20
Node IP [3]: 192.168.1.30
βœ… Added node: 192.168.1.30
Node IP [4]: [Enter to finish]

Result

  • All machines know about each other
  • Perfect 3-way replication
  • Any machine can fail and cluster continues
  • Files sync instantly between all folders

Example 2: Development Team Setup

Scenario

Development team with laptops and servers:

  • Developer Laptop: 192.168.1.100 β†’ /home/dev/projects
  • Build Server: 192.168.1.200 β†’ /opt/ci-builds
  • Staging Server: 192.168.1.201 β†’ /var/staging

Setup

Same process on all 3 machines:

./gluster-sync setup
Enter local folder: [respective folder for each machine]
All peer IPs: 192.168.1.100,192.168.1.200,192.168.1.201

Benefits

  • Code changes sync from dev laptop to all servers
  • Build artifacts available everywhere
  • Staging deployment sees latest code instantly

Example 3: Backup Strategy

Scenario

Primary server with 2 backup locations:

  • Main Server: 192.168.1.50 β†’ /opt/data
  • Backup Site 1: 192.168.1.51 β†’ /backup/data
  • Backup Site 2: 192.168.1.52 β†’ /backup2/data

Setup

# Same on all machines
./gluster-sync setup
All peer IPs: 192.168.1.50,192.168.1.51,192.168.1.52

Result

  • Real-time replication to both backup sites
  • If main server fails, backups have latest data
  • Perfect disaster recovery setup

Key Benefits of This Approach

βœ… Complete Mesh Network: Every node knows about every other node
βœ… Better Fault Tolerance: No single point of failure
βœ… Automatic Replication: Data replicated across all nodes
βœ… Easy Management: Same configuration everywhere
βœ… Scalable: Easy to add/remove nodes

Management Commands

# Check cluster status from any machine
./gluster-sync status

# Remove a node (run on that machine)
./gluster-sync remove

# View all connected peers
docker exec glusterfs-node gluster peer status

# Check volume health
docker exec glusterfs-node gluster volume status shared

This approach makes your GlusterFS cluster incredibly robust and easy to manage!