https://github.com/leo-project/simplenfs
NFS implementation by Erlang
https://github.com/leo-project/simplenfs
Last synced: 14 days ago
JSON representation
NFS implementation by Erlang
- Host: GitHub
- URL: https://github.com/leo-project/simplenfs
- Owner: leo-project
- Created: 2014-04-18T09:22:46.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-05-23T06:03:37.000Z (almost 11 years ago)
- Last Synced: 2025-04-14T20:09:39.444Z (14 days ago)
- Language: Erlang
- Size: 271 KB
- Stars: 10
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
simplenfs
=========
* Purpose
- Confirm whether the performance handling NFS protocol generated by [erpcgen](https://github.com/leo-project/erpcgen/) is sufficient or not
- Need less to say, Out of expectation use in production* Limitations
- Lock manager protocol is not implemented
- The max length of file path is limited up to 64 byte in order to make code concise
- Some rpcs listed as below are not implemented regarding symbolic link and special file
* Not implemented
- readlink
- symlink
- mknod
- link
- readdir* How to set up NFS server
- Install/Start
```sh
## prerequirements: Erlang alrady installed
## on shell
git clone https://github.com/leo-incubator/simplenfs.git
cd simplenfs
make
## Start dependent services
sudo /etc/init.d/rpcbind start
sudo /etc/init.d/rpcidmapd start
erl -pa ebin
```
```erlang
%% on erlang shell
%% Start NFS written in Erlang!
simplenfs:start().
```* How to set up NFSv3 client
- Install
```sh
## on shell
sudo yum install nfs-utils
```- Configure
```sh
## set MOUNTD_NFS_V3 to yes
sudo vi /etc/sysconfig/nfs
## set Defaultvers to 3
sudo vi /etc/nfsmount.conf
```- Start dependent services
```sh
sudo /etc/init.d/rpcbind start
```- Mount/Uumount
```sh
## mkdir for the mount point
sudo mkdir /mnt/nfs
sudo chown user:group /mnt/nfs
## mount without lock manager
sudo mount -t nfs -o nolock server:/path/for/expose /mnt/nfs
## now you can do almost file operations
echo "hello world" > /mnt/nfs/test.txt
chmod 400 /mnt/nfs/test.txt
ls -al /mnt/nfs
cat /mnt/nfs/test.txt
vi /mnt/nfs/test.txt
mv /mnt/nfs/test.txt /mnt/nfs/test2.txt
rm /mnt/nfs/test.txt
mkdir -p /mnt/nfs/0/1/2/3
find /mnt/nfs -type d -ls
rmdir /mnt/nfs/0/1/2/3
rm -rf /mnt/nfs/0
ls -al /mnt/nfs
## umount
sudo umount /mnt/nfs
```* TODO
- Reduce network traffic since there are some needless round trip between Client/Server
- Implement acceptor pool
- Implement file handle cache as necessary
- benchmark and compare with a generic NFS server