Coder Social home page Coder Social logo

imrajdeepb / distributed-file-system Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hasil-sharma/distributed-file-system

0.0 1.0 0.0 56 KB

Distributed File System written in C which implements some of the features of a large-scale distributed file system

Makefile 1.31% C 98.69%

distributed-file-system's Introduction

DISTRIBUTED-FILE-SYSTEM -

An implementation of distributed file system in C with user management which stores files across multiple servers and retrieve the files stored when required. Files are split into multiple chunks (depending on number of servers) and each of those chunks are partitioned across the servers on the basis of hash-value of the file contents. A chunk is stored on more than one servers to account for server failure(s) if any.

Implementation also supports handling multiple (using forking) clients with valid user name and password in parallel.

USAGE -

Compiling:

  • make dfs : Compiles the server instance in bin/dfs
  • make dfc : Compiles the client instance in bin/dfc
  • make client : Compiles the client instance in bin/dfc and starts the client instance (reading configuration file from conf/dfc.conf)
  • make clear : Clears the content of DFS directories
  • make kill : Kills the running server instance
  • make clean : Deletes previously created binary files
  • make start : Starts four server instances and stores logs corresponding to each instance in logs/ folder
  • make run : Starts tail -f on logs/ directory
  • make all : Runs clean dfs dfc start run targets

Starting Server:

To start all the servers at once use make start or to manually start ith server use following command:

bin/dfs /DFS<i> <ith port number>

Server reads its configuration file which has user name and passwords from conf/dfs.conf

Starting Client:

To start client via make file use make client or to manually start the client use following command:

bin/dfc <configuration-file-path>

Configration file is a required arguement, refer to conf/dfs.conf for sample configuration file

COMMANDS -

After successfully compiling and running servers and client, following commands can be sent to servers via clients command line prompt

GET

Used to fetch the remote file from servers into a local directory. This gives an error in case not enough servers are running to get the file properly or in case remote-file-path or local-file-path doesn't exist.

Syntax: GET <local-file-path> <remote-file-path>

PUT

Used to put a local file onto servers. This gives an error in case remote-file-path or local-file-path does not exsts. Please do not execute this command when not all the servers are up and running.

Syntax: PUT <local-file-path> <remote-file-path

LIST

Lists all the files and folders in give directory. Gives an error when requested remote folder does not exists. Along with file name it also shows whether or not file can be successfully downloaded from the servers. If file cannot be downloaded properly the command append INCOMPLETE with the file name.

Syntax: LIST <remote-folder-name>

MKDIR

Makes a directory or sub-directories in the path sent. Gives an error when requested folder already exists. Pleae do not execute this command when not all the servers are up and running.

Syntax: MKDIR <remote-folder-name>

distributed-file-system's People

Contributors

hasil-sharma avatar

Watchers

 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.