NFS Server configuration
Run the below commands to begin the NFS Server installation:
[nfs-server ]# yum install nfs-utils rpcbind
Next we export some arbitrary directory called /opt/nfs .
Create /opt/nfs directory:
[nfs-server ]# mkdir -p /opt/nfs
and edit /etc/exports NFS exports file to add the below line while replacing the IP
address [Link] with the IP address of your client:
/opt/nfs [Link](no_root_squash,rw,sync)
[root@web ~]# cat /etc/exports
#/data/ [Link]/24(rw,sync,no_root_squash,no_all_squash)
/data/ [Link](rw,sync,no_root_squash,no_all_squash)
/data/ [Link](rw,sync,no_root_squash,no_all_squash)
/data/ [Link](rw,sync,no_root_squash,no_all_squash)
/data/ [Link](rw,sync,no_root_squash,no_all_squash)
[root@web ~]#
Next make sure to enable 2049 port on your firewall to allow clients requests:
[nfs-server ]# firewall-cmd --zone=public --add-port=2049/tcp --permanent
[nfs-server ]# firewall-cmd --reload
Start rpcbind daemon and NFS server in this order:
[nfs-server ]# service rpcbind start; service nfs start
[root@web ~]# exportfs
/data [Link]
/data [Link]
Check the NFS server status:
[nfs-server ]# service nfs status
[Link] - NFS Server
Loaded: loaded (/usr/lib/systemd/system/[Link]; disabled)
Active: active (exited) since Thu 2014-12-11 08:12:46 EST; 23s ago
Process: 2780 ExecStart=/usr/sbin/[Link] $RPCNFSDARGS $RPCNFSDCOUNT
(code=exited, status=0/SUCCESS)
Process: 2775 ExecStartPre=/usr/sbin/exportfs -r (code=exited,
status=0/SUCCESS)
Process: 2773 ExecStartPre=/usr/libexec/nfs-utils/scripts/nfs-
[Link] (code=exited, status=0/SUCCESS)
Main PID: 2780 (code=exited, status=0/SUCCESS)
CGroup: /[Link]/[Link]
[root@app1 data]# mount [Link]:/data /data/
Vi /etc/fstab
# /etc/fstab
# Created by anaconda on Thu Sep 22 11:29:05 2016
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
UUID=f7c5d69f-ceef-43d6-8c1d-b5d36e019f23 / xfs defaults 00
UUID=c9660c4d-6165-4002-bdcd-2965330640d1 /app xfs defaults 00
UUID=fb9c2470-c4f5-433d-bc1f-444ca50116c3 /backup xfs defaults 00
UUID=b5b29a13-06e5-48ec-94f0-e3ba61945c1b /boot xfs defaults 00
UUID=45217604-5ee8-411d-8d4d-c1507472cf31 swap swap defaults 00
[Link]:/data /data nfs defaults 00