#
Setup NFS Server
The instructions on this page are done entirely on the head node.
On the head node, do:
dnf install -y nfs-utils
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 you should 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.
#
Testing
If all was successful, then the following should be the case on the head node:
The
export
directory exists, and contains these four directories:[root@chead1 ~]# ls /export/ apps data service site
The
export
directory has these permissions:[root@chead1 ~]# ls -l /export total 0 drwxrwxr-x. 2 root root 6 Sep 20 09:36 apps drwxrwxr-x. 2 root root 6 Sep 20 09:36 data drwxrwxr-x. 2 root root 6 Sep 20 09:36 service drwxrwxr-x. 2 root root 6 Sep 20 09:36 site
The files
/etc/exports
and/etc/fstab
both contain the information from the instructions.The
opt
directory exists, and contains these four directories:[root@chead1 ~]# ls /opt/ apps data service site
The command
systemctl status nfs-server.service
shows the service as active with no errors.The command
showmount --exports
displays that the correct directories have been exported, e.g.[root@chead1 ~]# showmount --exports Export list for chead1.pri.mycluster1.cluster.local: /home 10.50.0.0/16 /export/site 10.50.0.0/16 /export/service 10.50.0.0/16 /export/data 10.50.0.0/16 /export/apps 10.50.0.0/16