The full name of NFS is the network file system. Developed by Sun, the current mainstream version for V4,NFS monitoring on tcp2049 ports.
However, NFS is only responsible for data sharing, the connection of each host on the network and the respective IP port information is managed by another small partner, called Rpc--remote Protocol call, which is called remote procedure.
Step 1.
Pack:
Yum Install Nfs-utils
Yum Install Rpcbind
Step 2.
Configure/etc/exports
Format: Shared Path shared objects (options)
Options include: Ro,rw,sync,async,root_squash,no_root_squash,wdelay,all_squash
Where the default option is Ro,sync,wdelay,root_squash
RO: Shared directory read-only
RW: Shared directory readable and writable
Sync: Make sure that the in-memory data is completely written to disk and returned successfully.
Async: The In-memory data was not fully written to disk and returned successfully.
Wdelay: Write to disk after multiple write requests are merged
Root_squash: When the client root account is accessed, the server is displayed as Nfsnobody
No_root_squash: Client root, server side or root
All_squash: Regardless of the client account, the server side is Nfsnobody
Step3. Mounting NFS shares
Mount directory: mount-t nfs-o option server:/Directory/local Directory
Update the Fstab file to make the next reboot effective: Echo server:/directory/local directory NFS defaults 0 0>>/etc/fstab
Step4. Firewall settings
Because firewalls can only policy on specific ports, NFS and Rpcbind traffic generates random ports, and in order to secure ports, the/etc/sysconfig/nfs file needs to be configured
Limited to: Mount_port lockd_tcpport locked_udpport Statd_port
and release the 111 port of Rpcbind and the 2049 Port of NFS
Tip: Exportfs-r re-read export file
Exportfs-v Show Details
Reference: "Linux operation and maintenance of the road" Ding Mingyi
NFS Server Setup under Linux