This guide explains how to deploy Garage as a multi-node cluster with data replication. This is the recommended setup for production environments, providing high availability and fault tolerance.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/deuxfleurs-org/garage/llms.txt
Use this file to discover all available pages before exploring further.
Overview
A production Garage cluster requires at least 3 nodes to enable three-way replication, the safest and most available mode. This ensures your data remains accessible even if one node fails.Prerequisites
Before deploying a multi-node cluster:- At least 3 machines with sufficient storage space
- Direct IP connectivity between all nodes (IPv4 or IPv6)
- For nodes behind NAT, consider:
Architecture Planning
Sample Infrastructure
Consider this example cluster layout:| Location | Name | IP Address | Disk Space | Zone | Capacity |
|---|---|---|---|---|---|
| Paris | Mercury | fc00:1::1 | 1 TB | par1 | 1T |
| Paris | Venus | fc00:1::2 | 2 TB | par1 | 2T |
| London | Earth | fc00:B::1 | 2 TB | lon1 | 2T |
| Brussels | Mars | fc00:F::1 | 1.5 TB | bru1 | 1.5T |
Garage stores three copies of data on nodes at different locations. In this example, the usable capacity is 1.5 TB (limited by Brussels).
Best Practices
Storage Configuration
Storage Configuration
- Metadata directory: Store on SSD for fast access to frequently-used metadata
- Data directory: Store on HDD for large, slower storage
- Multiple HDDs: Supported natively without RAID
Filesystem Recommendations
Filesystem Recommendations
- Data directory: Use XFS for best performance (EXT4 has inode limitations)
- Metadata directory: Use BTRFS or ZFS for checksumming and integrity
- Database engine: LMDB (default) for performance, or SQLite for robustness
Performance Tuning
Performance Tuning
- For fast networking and large files: Set
block_size = "10M" - Enable automatic snapshots:
metadata_auto_snapshot_interval = "6h" - Use compression:
compression_level = 2
Capacity Planning
Capacity Planning
- Balance capacity across zones for optimal utilization
- Garage replicates across zones, not just nodes
- Ensure similar capacity in each zone to avoid under-utilization
Installation
Get Docker Image
Pull the Garage Docker image on each node:Always use a fixed version tag (e.g.,
v2.2.0) instead of latest for production deployments.Directory Structure
Create the following directories on each node:Configuration
Generate RPC Secret
Generate a shared secret for secure node communication:Use the same value for all nodes in the cluster.
Starting Nodes
Using Docker
Start Garage on each node:Using
--network host allows direct node-to-node communication, especially important for IPv6.Using Docker Compose
Alternatively, create adocker-compose.yml file:
Cluster Formation
Verify Nodes are Running
On each node, check that Garage is running:Or create an alias:Initially, each node will show
NO ROLE ASSIGNED.Connect Nodes Together
From any node, connect to the other nodes:
You don’t need to connect every node to every other node. Nodes discover each other transitively.
Configuring Cluster Layout
Assign Node Roles
Assign capacity, zone, and tags to each node:Parameters:
-z: Zone identifier (e.g., datacenter location)-c: Storage capacity available to Garage-t: Optional tags for node identification
Managing the Cluster
Creating Buckets and Keys
Monitoring
Upgrading
To upgrade a node:Troubleshooting
Nodes Cannot Connect
- Verify firewall rules allow port 3901 (RPC)
- Check
rpc_public_addris set correctly on all nodes - Ensure all nodes use the same
rpc_secret
Layout Changes Not Taking Effect
Checking Logs
Next Steps
- Configure systemd service for non-Docker deployments
- Set up monitoring for your cluster
- Configure reverse proxy for external access
- Learn about Kubernetes deployment