#
b. Configure NFS
The next step is to setup NFS.
On the login node:
Make a directory for everything that we may want to share.
mkdir /export mkdir /export/{apps,data,service,site}
Ensure that permissions are correct.
chmod 775 -R /export/
Go to
/etc/exports
and add this:/export/apps 10.50.0.0/16(rw,no_root_squash,sync) /export/data 10.50.0.0/16(rw,no_root_squash,sync) /export/service 10.50.0.0/16(rw,no_root_squash,sync) /export/site 10.50.0.0/16(rw,no_root_squash,sync) /home 10.50.0.0/16(rw,no_root_squash,sync)
The IP addresses and subnet mask you need to use will be different.
Bind mounts for the NFS server. Open the the file
/etc/fstab
and add this, then save and close the file./export/apps /opt/apps none defaults,bind 0 0 /export/data /opt/data none defaults,bind 0 0 /export/service /opt/service none defaults,bind 0 0 /export/site /opt/site none defaults,bind 0 0
Create several new directories:
mkdir /opt/{apps,data,service,site}
Start and enable NFS:
systemctl start nfs-server.service systemctl enable nfs-server.service
start
activates NFS, andenable
means that NFS will startup on boot.Export and show the mount points, then mount them.
exportfs -va mount -a
the
v
option shows more information and thea
option exports/mounts all.
The NFS server has now been setup. Follow the instructions on the compute nodes tab to complete setup.
On a compute node:
Open the file
/etc/fstab
and add the following text, then save and exit.chead1:/export/apps /opt/apps nfs rsize=32768,wsize=32768,vers=3,_netdev,nofail 0 0 chead1:/export/data /opt/data nfs rsize=32768,wsize=32768,vers=3,_netdev,nofail 0 0 chead1:/export/service /opt/service nfs rsize=32768,wsize=32768,vers=3,_netdev,nofail 0 0 chead1:/export/site /opt/site nfs rsize=32768,wsize=32768,vers=3,_netdev,nofail 0 0 chead1:/home /home nfs rsize=32768,wsize=32768,vers=3,_netdev,nofail 0 0
Make directories for NFS:
mkdir /opt/{apps,data,service,site}
Start NFS
systemctl start nfs-client.target systemctl enable nfs-client.target
Mount NFS
mount -a
At this point, this node is fully setup to be an NFS client. Repeat these steps on every other compute node, and then NFS will be completely set up.