Garage
Geographically distributed S3-compatible object storage system built for self-hosting
# Garage -S3 compatible object storage for Lazy Cat Cloud Geographically distributed S3-compatible object storage system built for self-hosting. ##Overview Garage is a lightweight distributed object storage system that implements the S3 API. This package contains: - **Garage Server **: Support multi-node S3 compatible object storage - **Web UI**: Administrative interface for bucket, key and cluster management ##Functional characteristics - S3 compatible API (compatible with AWS SDK and tools) - Geographically distributed architecture that supports automated replication - Support static website hosting - Built-in key-value storage (K2V API) - Lightweight and resource-efficient - Simple cluster management ##Get started quickly ###Build a software package ```bash cd garage ./ build.sh lzc-cli package ``` ###Test ```bash #Build an application lzc-cli project build #Install to your lazy cat device lzc-cli app install #View status and logs lzc-cli app status com.c4605.garage lzc-cli app log com.c4605.garage ``` ##Open port | port| service| described| |------|---------|-------------| | 3900 | S3 API |Major S3 compatible API endpoints| | 3901 | RPC |Internal cluster communication| | 3902 | Web |Static website hosting endpoints| | 3903 | K2V API |K2V API endpoints| | 3904 | Admin API |Cluster management and indicators| | 3909 | Web UI |Garage's Web UI| ##Custom Configuration Open the Lazy Cat Micro Service App, click the three points in the upper right corner of Garage to open the menu, click "Application Details", add the environment variable `GAGE_CONFIG_FILE` to "Environment Variables", and point to the configuration file you have modified (for example, point to `/lzcapp/var/garage.toml`, so that the configuration file is actually in `/data/appvar/com.c4605.garage/garage.toml`) Or use the [`compose override`](https://developer.lazycat.cloud/advance-composise-override. html) function to override the volume to `...:/ etc/garage.toml` ##Initialization Settings After deployment, you need to initialize the Garage cluster: 1. Open `https://garage.$ {BOXNAME}.heiyu.space` 2. Click on the `Cluster` tab, click the three vertical dots next to the node, and click `Assign` to configure 3. Click on the `Buckets` tab to create and configure the bucket ##Multi-node cluster configuration If you want to deploy a multi-node Garage cluster for data redundancy and high availability, you can see the following instructions or refer to the official documentation https://garagehq.deuxfleurs.fr/documentation/cookbook/real-world/ ###Prerequisite requirements - At least 2 devices (3 or more recommended) - Networks are interoperable between all nodes (port 3901) - All nodes use the same rpc_secret (configured at installation time) ###Configuration steps #### 1. Get the node ID on the first node After installing and starting Garage on the first node, obtain the Node ID through the Garage UI or the Garage command. Example: ``` 563e1ac825ee3323aa441e72c26d1030d6d4414aeb3dd25287c531e7fc2bc95d ``` #### 2. Configure RPC public addresses Make sure that `rpc_public_addr` in `garage.toml` is set to the actual accessible address of the node: ```toml rpc_bind_addr = "[::]:3901" rpc_public_addr = "192.168.1.10:3901" #Change to the actual IP of the node ``` #### 3. Create a cluster layout Open the Cluster tab of the Web UI of any node, click the Connect button, and connect to all other nodes. The node name format is: `<node public key>@<node public IP or hostname>:<port>`. After connecting, click the three dots next to the node, click assign, and complete the configuration. You can also use the garage command to configure: ```bash #Connect all nodes garage node connect "<node public key>@<node public IP or hostname>:<port>" # ... #View all node status garage status #Assign roles to each node (take 3 nodes as an example) garage layout assign -z dc1 -c 10G <node1_id> garage layout assign -z dc2 -c 10G <node2_id> garage layout assign -z dc3 -c 10G <node3_id> #Application Layout garage layout apply --version 1 ``` ###Cluster configuration instructions - **Zone (-z)**: Identifier of the area/data center where the node is located - Nodes in the same area are usually located in the same physical location - Garage will try to distribute copies in different zones - **Capacity (-c)**: Storage capacity of the node - SI units used: G (GB), T (TB) - Examples: `10G`,`500G`,`1T` ###Verify cluster status ```bash #Check cluster status garage status #View cluster layout garage layout show ``` All nodes should appear as HEALTHY and have roles assigned. ###Notes ˇ* * Important Tips **: - All nodes must use the ** same ** rpc_secret - Ensure that the firewall allows port 3901 (RPC traffic) ##Using S3 Client ### AWS CLI ```bash aws configure set aws_access_key_id <YOUR_ACCESS_KEY> aws configure set aws_secret_access_key <YOUR_SECRET_KEY> aws --endpoint-url "https://garage.$ {BOXNAME}.heiyu.space:3900" s3 ls ``` ### s3cmd ```bash s3cmd --host=garage-host:3900 --host-bucket="https://garage.$ {BOXNAME}.heiyu.space:3900" ls ``` ##Storage Location - Metadata: `/data/appvar/com.c4605.garage/meta` - Data: `/data/appvar/com.c4605.garage/data` - Configuration: `/data/appvar/com.c4605.garage/garage.toml` ##Document - Official document: garagehq.deuxfleurs.fr/documentation/ - Quick Start: garagehq.deuxfleurs.fr/documentation/quick-start/ - S3 API:https://garagehq.deuxfleurs.fr/documentation/reference-manual/s3-compatibility/ ##License AGPL-3.0 (Garage Project) ##Link - Garage homepage: garagehq.deuxfleurs.fr/ - Source code: git.deuxfleurs.fr/Deuxfleurs/garage - Web UI:https://github.com/khairul169/garage-webui




