Dec 13, 2017

How to set up NFS server on Amazon AMI EC2

Setting Up the NFS Server

Step One—Download the Required Software

sudo yum install nfs-utils

Subsequently, run several startup scripts for the NFS server:

sudo chkconfig nfs on
sudo service rpcbind start
sudo service nfs start

Step Two—Export the Shared Directory

We need to export the directory:

vi /etc/exports
  • rw: This option allows the client server to both read and write within the shared directory
  • sync: Sync confirms requests to the shared directory only once the changes have been committed.
  • no_subtree_check: This option prevents the subtree checking. When a shared directory is the subdirectory of a larger filesystem, nfs performs scans of every directory above it, in order to verify its permissions and details. Disabling the subtree check may increase the reliability of NFS, but reduce security.
  • no_root_squash: This phrase allows root to connect to the designated directory
Once you have entered in the settings for each directory, run the following command to export them:

exportfs -a