# NFS_FUSE_Implementation
Objective :
Build a simple distributed file system.
The file system will assume an NFS-like protocol.
The file system will integrate into the Linux client side using FUSE.
https://github.com/adithyabhatp2/NFS_FUSE_Implementation
Status:
vim - sometimes errors out during closing
Issue - gettimens not implemented. SETATTR hangs, the only dependency not implemented is gettimens.
To Run
------
cd client_side/v4
make client
./fuseClient.o -f -d mtpt [-f and -d are the foreground and debug flags]
cd server_side/v2
make server
./server.o <pathToFolderToBeExposed>
Versions
--------
Client v2 == Server v1 : port 9080. Writes not flushed.
Client v3: commit + individual connxns
Client v4: single connxn + retry for server crash
: Locks for the write caches
Design
-------
FUSE Client
Per FUSE method, one entry in RPCGateway/RPCClient
RPC Gateway - serialization + convert method params to RPC compatible types.
RPC Client - sends the messages
RPC Server - recvs the messaages
RPC Gateway - deserializes + converts param types back to FUSE types
NFS Server - executes the method on the underlying FS
WriteCache - thread safe wrapper of vector<WriteCacheEntry>
WriteCacheEntry - all the info in a write FUSE/syscall
NOTE:
e.g. - write FUSE call returns int, and the passed buf is filled.
Hence the RPCGateway will have to convert to GRPC Request/Response types.
Setting up GC Compute Engine
-----------------------------
sudo apt-get install gcc g++ make git libfuse-dev
GRPC on Google Cloud
--------------------
https://github.com/grpc/grpc/blob/master/INSTALL.md
Protobuf on GC
--------------
sudo apt-get install autoconf automake libtool curl make g++ unzip
https://github.com/google/protobuf/blob/master/src/README.md
FileBench on GC
----------------
sudo apt-get install libtool byacc flex
https://github.com/filebench/filebench
Libraries have been installed in:
/usr/local/share/filebench/cvars
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/share/filebench/cvars"
FUSE on Google cloud
---------------------
apt-cache search fuse
sudo apt-get install libfuse-dev
Cleaning up after running a FUSE client :
fusermount -u mnt OR sudo umount <path to dir>
Thrift on GC
------------
ignore : https://thrift.apache.org/docs/install/debian
ignore : sudo apt-get install thrift-compiler
mkdir /unsup/thrift-0.9.3
downloaded the tar, http://www.apache.org/dyn/closer.cgi?path=/thrift/0.9.3/thrift-0.9.3.tar.gz
./configure
make
make install
https://thrift.apache.org/docs/BuildingFromSource
Libraries have been installed in: /usr/local/lib
Include : /usr/local/include
LD_LIBRARY_PATH : Added /usr/local/lib
Building FUSE on CSL
--------------------
restricted access in CSL machines. use ./configure --prefix="~/..."
configure: MOUNT_FUSE_PATH env var not set, using default /sbin
configure: UDEV_RULES_PATH env var not set, using default /etc/udev/rules.d
configure: INIT_D_PATH env var not set, using default /etc/init.d
Action - set all to /u/a/d/adbhat/Software/<appropriate>
Libraries have been installed in:
/u/a/d/adbhat/Software/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
Action - in ~/.bashrc CSL
-------------------------
# adding for cs739 Distbtd p2
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/u/a/d/adbhat/Software/lib
export LD_RUN_PATH=$LD_RUN_PATH:/u/a/d/adbhat/Software/lib
export MOUNT_FUSE_PATH=/u/a/d/adbhat/Software/sbin
export UDEV_RULES_PATH=/u/a/d/adbhat/Software/etc/udev
export INIT_D_PATH=/u/a/d/adbhat/Software/etc
export PATH=$PATH:/u/a/d/adbhat/Software/bin
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/u/a/d/adbhat/Software/lib/pkgconfig
Creating google Cloud:
------------------------
cloud.google.com
Free trial - 300$ for 2 months
Forget the coupon, can use it later if necessary
Go to the console
Create Compute Engine
Create with good specs!! (4vCPUs, Ubuntu 14.04)
straightfwd, like the azure portal
click on the ip under ssh for the Compute engine, will lead to instructions for creating a key pair..
use the key (ssh -i username@:<public ip> )
public ip changes if you shut down and restart, so verify
Not very costly, left it overnight, took only 1$