The cluster layout in Garage is a table that assigns to each node a role in the cluster. The role of a node in Garage can either be a storage node with a certain capacity, or a gateway node that does not store data and is only used as an API entry point for faster cluster access.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.
How Cluster Layouts Work
A cluster layout is composed of the following components:- A table of roles assigned to nodes, defined by the user
- An optimal assignation of partitions to nodes, computed by an algorithm that runs when calling
garage layout apply - A version number
Managing Layout Changes
Viewing the Current Layout
To inspect the current layout and any proposed changes:- Current cluster layout with node capacities and zone information
- Staged role changes (if any)
- Preview of the new layout after applying changes
- Partition distribution statistics
Assigning Node Roles
To add or modify a node’s role in the cluster:node_id: Node identifier (prefix of hexadecimal node ID)-z, --zone: Location or datacenter of the node-c, --capacity: Storage capacity (e.g.,100GB,2TB)-t, --tag: Optional tags for organization-g, --gateway: Mark as gateway-only node (no data storage)
Removing Nodes
To remove a node from the cluster:Replacing Failed Nodes
When replacing a failed node, you can directly substitute it:Applying Layout Changes
The commands above only stage changes. To apply them:garage layout show.
Reverting Staged Changes
To cancel staged changes without applying them:Critical Warnings
Understanding Layout Calculations
The layout algorithm prioritizes:- Minimizing data movement between nodes over equal distribution
- Using all links equally between node pairs when moving data
Example 1: Adding a Node to an Existing Zone
When adding a fourth node to a 3-node cluster (3 zones, equal capacity):- The other two zones (dc2, dc3) must still store a full copy of all data
- Adding capacity to dc1 doesn’t increase total cluster capacity
- No data movement is needed
Example 2: Moving a Node Between Zones
When moving a node from a zone with 2 nodes to a zone with 1 node, data will be redistributed proportionally from all possible sources.Garage uses all node-to-node links in equal proportions when transferring data. This may result in unexpected but optimal distributions.
Advanced Configuration
Zone Redundancy
Configure how data is distributed across zones:none: No zone redundancy requirementmax: Maximum zone redundancy (recommended)- Integer: Specific number of zones
Layout History
View the history of layout changes:Skipping Dead Nodes
If nodes are permanently offline and preventing layout synchronization:Best Practices
- Always review changes with
garage layout showbefore applying - Test layout changes in a staging environment first
- Document your topology with meaningful zone names and node tags
- Plan capacity based on your replication factor and zone distribution
- Monitor partition distribution to ensure balanced load
- Avoid frequent layout changes - let data stabilize between changes