server-side (192.168.1.1) configuration method (The following configuration is only done on the primary node)
(1)/etc/exports file configuration
Add the following lines to the file/etc/exports
Shared directory authorization Host (parameters, "parameters")
Example:/usr/cluster 192.168.1.2 (rw)
/usr/cluster 192.168.1.3 (rw)
/usr/cluster 192.168.1.4 (rw)
If you are sharing the root directory, you need to add the No_root_squash parameter to prevent other users from being mapped to nobody without write permission
(2) Start NFS service with only two commands
Service Portmap Start
Service NFS Start
Note: In the latest kernel, the Daemon for NFS is changed to Rpcbind, and if it is a new kernel, the start of the NFS daemon should be "service Rpcbind start"
Client Configuration method (192.168.2|3|4)
(1) Create a shared directory
Establish the same shared directory as the server for shared server files
Example: Mkdir/usr/cluster
(2) View the shared directory that the server already has (can not be done)
SHOWMOUNT-E 192.168.1
(3) Mount shared directory
Example: Mount-t NFS 192.168.1.1:/usr/cluster/usr/cluster
Note: This can be done to automate the mount
Edit the/etc/fstab file in which you enter the following code
192.168.1.1:/usr/cluster/usr/cluster NFS Defaults 0 0