Course Project for CX4013 Distributed Systems at Nanyang Technological University, Singapore.
Video Demo: https://youtu.be/UROoUfE-oF0
- Java >= 11
- Python >= 3.6
See https://github.com/zhangks98/CX4013-NFS/releases
usage: nfs-server [-h] -m {ALO,AMO} [-l LOSS_PROB] port path
Server for Remote File Access
positional arguments:
port Server port.
path Root directory for the server.
optional arguments:
-h, --help show this help message and exit
-m {ALO,AMO}, --mode {ALO,AMO}
Invocation semantic.
-l LOSS_PROB, --loss-prob LOSS_PROB
Probability of a response loss; default is 0.0
Usage: nfs-client [-hV] [-f=<freshInterval>] [-l=<lossProb>] <address> <port>
The client for remote file access.
<address> The address of the file server.
<port> The port of the file server.
-f, --fresh-interval=<freshInterval>
Freshness interval (in ms) of the client cache. Default
value: 15000
-h, --help Show this help message and exit.
-l, --loss-prob=<lossProb>
Probability of a request loss. Default value: 0
-V, --version Print version information and exit.
The following commands are available:
<> - required arguments
[] - optional arguments
| read <file path> [offset] [count] |
| insert <file path> <offset> <data> |
| append <file path> <data> |
| register <file path> <monitor interval (ms)> |
| touch <new file path> |
| ls [dir] |
| help |
| exit |
-
Assemble the executable
- On Linux/macOS:
./gradlew distZip
- On Windows:
gradlew.bat distZip
- On Linux/macOS:
-
Go to "build/distributions" folder and unzip the "nfs-client-1.0.zip" to a desired location.
-
To run the client:
- Change to the directory:
cd nfs-client-1.0
- On Linux/macOS:
bin/nfs-client [-hV] [-f=<freshInterval>] [-l=<lossProb>] <address> <port>
- On Windows: `bin\nfs-client.bat [-hV] [-f=] [-l=]
- Change to the directory:
-
Go to the "python" directory:
cd python
-
Create a Python (>=3.6) virtual environment:
virtualenv -p python3 ./venv
-
Activate the virtual environment:
- On Linux/macOS:
source ./venv/bin/activate
- On Windows:
.\venv\Scripts\activate
- On Linux/macOS:
-
Install the package
- For production:
pip install -U .
- For development:
pip install -e ".[dev,test]"
- For production:
-
To run the server:
nfs-server [-h] -m {ALO,AMO} [-l LOSS_PROB] port path