NFS Export Setup Guide for Ubuntu EC2
This guide covers the steps to set up NFS export to share a directory from an Ubuntu server running on EC2.
Steps
Start an Ubuntu EC2 instance and check the security group to make sure that the NFS port on this server is open for connection from your NFS client servers.
Install NFS server.
$ sudo apt-get install nfs-kernel-server
Mount your objectivefs filesystem (e.g. on /ofs).
$ sudo mount.objectivefs <your filesystem> /ofs
In /etc/exports, add the following line where directory is the directory you would like to share and ip address is the ip address of the NFS client machines.
<directory> <ip addr>(rw,fsid=<unique id>,no_subtree_check,mp,async)
Example to allow the NFS client at 10.0.0.100 to mount /ofs:
/ofs 10.0.0.100(rw,fsid=222,no_subtree_check,mp,async)
In /etc/default/nfs-kernel-server, increase the number of threads on the NFS server.
RPCNFSDCOUNT=<number of threads> # e.g. 64
Restart the service.
$ sudo service nfs-kernel-server restart
$ sudo service idmapd restart # you may also need to restart idmap
Reference
- Exporting ObjectiveFS to Windows via NFS
- Filesystem Mount User Guide
- Mount on boot User Guide
- How To Mount an Instance Store on EC2 for Disk Cache
- How To Restrict S3 Bucket Policy to Only One S3 Bucket
Last updated ObjectiveFS staff
ObjectiveFS is a shared file system for macOS and Linux that automatically scales and gives you scalable cloud storage. If you have questions or article idea suggestions, please email us at support@objectivefs.com