19 个版本 (4 个稳定版)

1.2.0 2020年11月19日
1.1.1 2020年8月19日
1.0.0 2020年4月22日
0.19.0 2020年3月4日
0.9.0 2018年10月26日

数据库实现 中排名第 63

每月 45 次下载

MIT 许可证

1MB
20K SLoC

Frugalos

Frugal 对象存储

Crates.io: frugalos Documentation Build Status License: MIT

Frugalos 是用 Rust 编写的分布式对象存储。
它适用于存储中等大小的 Blob,总容量可达到 PB 级。

文档

安装

您可以通过以下命令安装 frugalos

$ cargo install frugalos

注意:当前安装过程需要 automakeautoconflibtool 来构建内部 liberasurecode。如果您尚未安装它们,请安装它们。(另请参阅 liberasurecode 的先决条件

您还可以从 发布页面 使用预构建的二进制文件。

简单示例

// Create a cluster.
$ frugalos create --id example --data-dir example/
Oct 26 13:42:06.244 INFO [START] create: local=Server { id: "example", seqno: 0, host: V4(127.0.0.1), port: 14278 }; data_dir.as_ref()="example/"; , server: [email protected]:14278, module: frugalos_config::cluster:121
Oct 26 13:42:06.245 INFO Creates data directry: "example/", server: [email protected]:14278, module: frugalos_config::cluster:113
Oct 26 13:42:06.256 INFO [START] LoadBallot: lump_id=LumpId("03000000000000000000000000000000"); , server: [email protected]:14278, module: frugalos_raft::storage::ballot:21
...
...

// Start a frugalos process in the background.
$ frugalos start --data-dir example/ &
Oct 26 13:46:16.046 INFO Local server info: Server { id: "example", seqno: 0, host: V4(127.0.0.1), port: 14278 }, module: frugalos_config::service:68
Oct 26 13:46:16.062 INFO [START] LoadBallot: lump_id=LumpId("03000000000000000000000000000000"); , module: frugalos_raft::storage::ballot:21
Oct 26 13:46:16.086 INFO Starts RPC server, server: 127.0.0.1:14278, module: fibers_rpc::rpc_server:221
...
...

// Add a device and a bucket to store objects.
$ DEVICE_JSON='{"file": {"id": "file0", "server": "example", "filepath": "example/file0.lusf"}}'
$ curl -XPUT -d "$DEVICE_JSON" https://127.0.0.1:3000/v1/devices/file0
{"file":{"id":"file0","seqno":0,"weight":"auto","server":"example","capacity":19556691462,"filepath":"example/file0.lusf"}}%

$ BUCKET_JSON='{"metadata": {"id": "bucket0", "device": "file0", "tolerable_faults": 1}}'
$ curl -XPUT -d "$BUCKET_JSON" https://127.0.0.1:3000/v1/buckets/bucket0
{"metadata":{"id":"bucket0","seqno":0,"device":"file0","segment_count":1,"tolerable_faults":1}}%

// PUT and GET an object.
$ curl -XPUT -d 'your_object_data' https://127.0.0.1:3000/v1/buckets/bucket0/objects/your_object_id
$ curl https://127.0.0.1:3000/v1/buckets/bucket0/objects/your_object_id
your_object_data

有关详细信息和其他可用 API 的信息,请参阅 REST API

对于 Frugalos 开发者

请参阅 开发者指南

依赖项

~16–28MB
~439K SLoC