GithubHelp home page GithubHelp logo

couchbaselabs / cbfs Goto Github PK

View Code? Open in Web Editor NEW
188.0 175.0 40.0 1.34 MB

Distributed Blobstore using Couchbase Server

Home Page: http://dustin.github.com/2012/09/27/cbfs.html

License: Apache License 2.0

Go 91.34% HTML 1.38% JavaScript 7.28%

cbfs's Introduction

GoDoc

cbfs is a distributed file server built on top of Couchbase

How do I get the stuff

go get github.com/couchbaselabs/cbfs

And you'll find the source in $GOPATH/src/github.com/couchbaselabs/cbfs (and a cbfs binary should be in your path)

How do I build the stuff

cd $GOPATH/src/pkg/github.com/couchbaselabs/cbfs
go build

How do I run the stuff

mkdir -p /tmp/localdata
./cbfs -nodeID=$mynodeid \
       -bucket=cbfs \
       -couchbase=http://$mycouchbaseserver:8091/
       -root=/tmp/localdata \
       -viewProxy

The server will be empty at this point, you can install the monitor using cbfsclient (go get github.com/couchbaselabs/cbfs/tools/cbfsclient)

cbfsclient http://localhost:8484/ upload \
    $GOPATH/src/github.com/couchbaselabs/cbfs/monitor monitor

Then go to http://localhost:8484/monitor/

Running on Docker / CoreOS

See Traun Leyden's blog post on Running CBFS + Couchbase Cluster on CoreOS.

cbfs's People

Contributors

andrewwebber avatar apage43 avatar bchavez avatar benlubar avatar dustin avatar fmeyer avatar igm avatar ingenthr avatar jichon avatar mschoch avatar tleyden avatar trondn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cbfs's Issues

View for showing storage in use.

Interesting side-effect: you get the storage in-use by subdirectory at a significantly lower cost than I get with du on local filesystems.

"master" service elector

"master" is probably not the best term, but we do want a few things that only run in one place. We could possibly separate them by service, but there are two main things we need:

  1. Have the nodes elect a master and record it into a key (e.g. /master).
  2. Have the master heartbeat itself with a CAS operation.

The election is either a CAS or ADD operation to ensure there's no conflict. Other nodes will need to occasionally verify this by pulling the document and checking the timestamp.

Node list

Probably /.cbfs/nodes/

Include heartbeat time, sizes, etc...

Susceptible to older time parsing bug

Marty noticed this trying to read some of the data from one of my nodes.

I don't think this is a view problem as much as it's likely to be a bug in the time parser. I tried it out on play.golang.org and it broke: http://play.golang.org/p/F4q7Rzx1B9

But locally:

dhcp-110:/tmp 716% go run thing.go 
2012-09-17 22:12:09.894702 +0000 UTC - <nil>

I think I worked around this in seriesly with a custom time parser (well, and I made it slightly faster). I'm going to add this test to the suite. I think it'll also fail on goci (where we have CI running outside of my box).

Record blob length.

While I'm storing the blob info, I might as well store the length of the blob. This would make it really easy to calculate the total size of the store, the size of a store within any range, amount of data being served, etc...

GC unused blobs

Find objects on a node that shouldn't exist and unexist them.

Probabilistic Eager Caching

Instead of always copying a blob to a secondary server when requesting and proxying, we should do this on a sliding probability scale. This will prevent excessive overcaching while still getting the hot stuff distributed widely.

Unify internal interfaces under a common path.

I think we should possibly have a /.cbfs/ path wherein we keep all the useful things. e.g.

  • PUT/GET/DELETE /cbfs/blob/[sha]
  • POST /.cbfs/blob/ (for the raw streaming thing)
  • GET /.cbfs/blob/ (list of all stored blobs)

etc...

Record blob frequency.

For balance management, let's keep a counter near the object that represents the blob that records how frequently the blob is accessed.

@mschoch, these should also be blindly deleted along with GC. I'm thinking something like /blobid/r or something for a read counter.

Redistribute blobs to new nodes

Nodes can do this when starting up. Just get the node list, blob counts per node and start pulling from hot ones. Let them trim down.

Find blobs by name through couchbase

Currently, we only work with local blobs. We can try that, but also retrieve the blob remotely if we don't have it locally by looking up a recent location through couchbase.

Proxying it should be a trivial http request against the raw blob and an io.Copy. You'll already have the headers.

This obviously depends on #1

Clean up after stale nodes.

If a node is stale, we should notice this and perhaps consider invalidating the "ownership" mappings that this node claims.

Don't overwrite user data on PUT

We have a proper protocol for managing user data. It makes sense to preserve this data across object mutations. Users who don't want this can always remove it on change. It can be tracked by recording object IDs or something in the data such that a view can pull out objects that haven't been processed or whatever.

@apage43, does this make sense to you?

Trim over-replication

Find objects that are excessively replicated and trim them down. Probably want to have a minimum lifetime on these over-replicated blobs. Ideally, we validate hotness more intelligently before trimming.

File listing interface

Someway to pull down a list of files, possibly between two ranges. Possibly simulating directories and excluding depth traversal.

blob metadata

We have file (name) metadata, but no blob (content) metadata. Sometimes you want to mark up the name and sometimes you want to mark up the contents. Both should be possible.

It's not complete clear what a metadata response would look like incorporating both. I guess I could do:

{"file": {}, "blob": {}}

and include whatever the user asked for.

@apage43 opinions?

Configurable default object

From a conversation with @apage43:

/ can map to a specifiable default object iff it's not a cbfs control request. Something like -default=/index.html

View proxy

Access your couchbase views for custom app awesomeness

Support HTTP HEAD

Might as well return headers if someone asks for it. It's a cheap operation.

Command endpoint to request a node take on a blob

This is related to #2 as it's an efficient way to accomplish it without having to copy the data through the requestor and will simplify the current takedown path by having the caller only have to deal with a destination.

Record oid locations when storing files

This can be a bit lazy, though it might make it harder to find files instantly after storing them. Not too worried about that. It can also reconcile easily with the list functionality.

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.