Coder Social home page Coder Social logo

libfrugalos's Introduction

Frugalos

Frugal Object Storage

Crates.io: frugalos Documentation Build Status License: MIT

Frugalos is a distributed object storage written by Rust.
It is suitable for storing medium size BLOBs that become petabyte scale in total.

Documentation

Installation

You can install frugalos by the following command:

$ cargo install frugalos

Note: The current installation process requires automake, autoconf, and libtool to build liberasurecode internally. If you have not installed them, please install them. (See also liberasurecode's prerequisites)

You can also use pre-build binaries from the releases page.

Simple Example

// 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" http://localhost: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" http://localhost: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' http://localhost:3000/v1/buckets/bucket0/objects/your_object_id
$ curl http://localhost:3000/v1/buckets/bucket0/objects/your_object_id
your_object_data

Please see REST API for details and other available APIs.

For Frugalos Developers

Please see Developer's Guide.

libfrugalos's People

Contributors

brly avatar dw-hkoba avatar koba-e964 avatar shinnya avatar sile avatar yuezato avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

libfrugalos's Issues

mds の RPC レスポンスで leader ノードが見つからないエラーが返ってきた場合にリトライしたい

frugalos プロセスが停止処理を開始すると一時的に No such node のエラーを返すことがある(理由は後述)。この場合には mds client が保持している leader をクリアして別の frugalos プロセスにリクエストをリトライすれば成功する確率が高い。No such node エラー時に leader をクリアするデメリットは特にない、はず(クラスタが stable な状態で No such node のエラーが継続的に出続けることはない)。

No such node のエラー用に ErrorKind を追加して、以下のコードのエラー処理で leader を取得しなおすよう変更すると対応できそうな感じがする。No such node のエラーが出ているタイミングではリーダー選出中の可能性が高く、リトライしたリクエストはリーダー選出待ちになることが多いはず。

return Err(track!(e, T::NAME));

No such node のエラーは以下のコードから返ってくる。

https://github.com/frugalos/frugalos/blob/8246fdb52b8a8ea5fb2ca4d2ddc2a40b76d6924a/frugalos_mds/src/server.rs#L56

エラーが発生する理由は、frugalos プロセスの停止処理中にプロセスが管理しているノード一覧が非 atomic に変動するから。その結果、mds のクライアント側が保持している leader ノードがサーバー側の frugalos プロセスにはすでにいなくなっているということが起きる。このエラーが出なくするのは非常に面倒だと予想しているので、エラー自体が出てしまうのは許容しておいた方が良さそうな印象。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.