# grs3 **Repository Path**: qiankun-cloud/grs3 ## Basic Information - **Project Name**: grs3 - **Description**: 基于go实现的分布式S3协议兼容对象存储服务 - **Primary Language**: Unknown - **License**: AGPL-3.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-03-22 - **Last Updated**: 2024-08-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 启动一个节点 ```shell go run main.go -id node0 ./data/node0 ``` 启动集群的子节点 ```shell go run main.go -id node1 -haddr :11001 -raddr :12001 -join :11000 ./data/node1 go run main.go -id node2 -haddr :11002 -raddr :12002 -join :11000 ./data/node2 ``` the HTTP bind address (which defaults to localhost:11000): ```shell curl -XPOST localhost:11000/key -d '{"foo": "bar"}' ``` You can read the value for a key like so: ```shell curl -XGET localhost:11000/key/foo ``` ## 功能实现思路 保存文件思路: 上传文件 1. 不考虑妙传功能 2. 文件储存到自建fs 3. objectKey路径存储元数据 删除文件 1. 根据objectKey获取元数据 2. 从元数据信息中获取分片路径 3. 删除分片 4. 删除objectKey对应元数据 下载文件 1. 根据objectKey获取元数据 2. 根据元数据信息获取分片路径 3. 用分片组装文件流 ### TODO 1. 分片上传失败时删除分片 DELETE http://localhost:11000/s3/new-bucket-0352c654/xxx.pdf?uploadId=9709ccc3-1a71-448e-acb4-50407e53fd48