Coder Social home page Coder Social logo

vonnyjap / godfs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rounakdatta/godfs

0.0 0.0 0.0 61 KB

[G|HD]FS inspired simple distributed filesystem

Home Page: https://rounakdatta.github.io/posts/godfs/

Go 97.29% Makefile 1.29% Dockerfile 1.42%

godfs's Introduction

GoDFS

Very Simple Distributed FileSystem implementation on the lines of GFS and HDFS

NameNode

The NameNode is the master and is the single point of contact (and failure!) for coordinating all operations. It provides the clients with all the required metadata for accessing the DataNodes.

DataNode

The DataNode is a simple data containing unit and clients talk to them directly to put / get data into / from them.

Client

The short-lived client does all the talking to get operations done. A read / write client can be initiated through the command line interface provided.

Usage

One NameNode and at least one DataNode(s) must be initiated as daemons through the command line interface provided.

Run unit tests as:

make test

The CLI can be compiled to a binary to obtain godfs as:

make build

Natively

  • DataNode daemon Syntax:

     ./godfs datanode --port <portNumber> --data-location <dataLocation>

    Sample command:

     ./godfs datanode --port 7002 --data-location .dndata3/
  • NameNode daemon Syntax:

     ./godfs namenode --port <portNumber> --datanodes <dnEndpoints> --block-size <blockSize> --replication-factor <replicationFactor> 

    Sample command:

     ./godfs namenode --datanodes localhost:7000,localhost:7001,localhost:7002 --block-size 10 --replication-factor 2
  • Client Currently Put and Get operations are supported

    • Put operation Syntax:
       ./godfs client --namenode <nnEndpoint> --operation put --source-path <locationToFile> --filename <fileName>
      Sample command:
       ./godfs client --namenode localhost:9000 --operation put --source-path ./ --filename foo.bar
    • Get operation Syntax:
       ./godfs client --namenode <nnEndpoint> --operation get --filename <fileName>
      Sample command:
       ./godfs client --namenode localhost:9000 --operation get --filename foo.bar

Containerized through Docker Compose

  • Build the images for the components:
     docker build -t datanode -f daemon/datanode/Dockerfile .
     docker build -t namenode -f daemon/namenode/Dockerfile .
     docker build -t client -f daemon/client/Dockerfile .
  • Initiate the DataNode and the NameNode services (scale up accordingly):
    docker-compose up --scale datanode=6 --remove-orphans --force-recreate
  • Start the client in a new container under the base host:
    docker run -it --network host client
  • Make file put and get requests using similar commands as above

Todo

  • NameNode's regular HeartBeat check for DataNodes
  • Re-replication in case of dying DataNode
  • Secondary NameNode

godfs's People

Contributors

rounakdatta avatar

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.