Skip to content

nathang15/go-fs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go AWS Distributed File System

Notice: Working now! This is for learning purposes!

  • The distributed file system is designed for basic file handling operations including write, read, delete and update.
  • Utilizes Leader-Follower architecture to handle the operations and the master(leader) is selected through the leader election process.
  • Tolerate multiple node failures without impacting file availability and file handling functionalities. Every file is written onto 3 nodes asynchronously via an active replication process to maintain 3 replicas of the file in case of node failure. The put and read operation make use of Simple Write Quorum wherein R = W = 2.
  • Utilizes heartbeat monitoring for failure detection. Every node sends and receives heartbeat messages from 2 successor and 2 predecessor nodes in a ring topology.

Benchmarks

Deployed on 3 AWS EC2 instances and 10 nodes. Achieved 35ms for write/update and 10ms for read for 100 Mb file size. Also working when not using AWS, just need to change up the config and main file.

Install and Run

  1. Set up PAT Code if you don't have it already.
  2. Set up 3 AWS EC2 Instance. I used Ubuntu t2.micro for all 3. Configure the security groups and VPC settings accordingly.
  3. Set up key pairs and ssh into all 3 instances accordingly.
  4. Edit the GatewayNodes value within the config.json file. Put in the value of the PRIVATE ip address of the instances you want to be the initial master/leader.
  5. Perform git clone this repo on all 3 instances.
  6. sudo apt-get update and sudo apt install golang-go
  7. cd go-fs/cmd and go build ./
  8. go run main.go -i to initialize the file system. Perform this command on the instance that has the private address you set up within GatewayNodes
  9. go run main.go on any 1 of the other 2 instances to Join the file system.
  10. go run main.go -g on the remaining 1 to act as the local/guest machine.
  11. The following commmands are available:
    ls
    lshere
    get <remote file> <local file>
    put <local file> <remote file>
    remove <remote file>
    locate <remote file>
    report
    exit
    
  12. Lastly, remember to STOP/TERMINATE the EC2 instances when you are done to avoid charges.

Roadmap

  • Membership (A group of nodes can form a membership.)

    • Determine leader to be the node that starts the membership
    • Each membership is a replica for the file service
    • Able to join and leave a group.
    • Handling node failures and network partitions.
    • Heartbeat to detect failures as shown
  • File Client and Server

    • File operations for Client:
      • put (upload)
      • get (download)
      • remove (delete)
      • locate (find)
      • ls (list all files)
      • lshere (list files at current node)
    • Server manage file storage and respond to client requests.
  • File Operation and Membership Commands

    • Initializing a new group
    • Joining an existing group
    • Leaving the group
    • File operations (put, get, remove, locate, ls, lshere)
  • Replication and Consistency

    • Data replication across multiple nodes.
    • Consistency for replicated data.
    • Sync for file operations.

About

Distributed File System with Raft

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published