Very Simple Distributed FileSystem implementation on the lines of GFS and HDFS
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.
The DataNode is a simple data containing unit and clients talk to them directly to put / get data into / from them.
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.
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
-
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:
Sample command:
./godfs client --namenode <nnEndpoint> --operation put --source-path <locationToFile> --filename <fileName>
./godfs client --namenode localhost:9000 --operation put --source-path ./ --filename foo.bar
- Get operation
Syntax:
Sample command:
./godfs client --namenode <nnEndpoint> --operation get --filename <fileName>
./godfs client --namenode localhost:9000 --operation get --filename foo.bar
- Put operation
Syntax:
- 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
andget
requests using similar commands as above
- NameNode's regular HeartBeat check for DataNodes
- Re-replication in case of dying DataNode
- Secondary NameNode