First, Introduction
NFS (Network file system/):1), set up file sharing between Linux systems (Linux and Windows intermediate file sharing using Samba services);
2), NFS is only a file system, itself does not have the transmission function, is based on the RPC protocol implementation, in order to reach two Linux system file directory sharing;
3), NFS for C/s architecture;
Second, configure the service side
1. Use the command rpm-q nfs-utils to see if Server for NFS is installed
Rpm-q Portmap
2. If not installed:
Yum Install Nfs-utils
--yum Install Portmap
3. Turn off the firewall
Iptables-f
4. Log on to the Linux server as root and edit the NFS profile: Open the Exports file by command Vi/etc/exports, specifying the shared directories and access permissions that are allowed to be accessed by other computers.
/nfs 192.168.1.* (Rw,sync,no_root_squash)
The above line is interpreted as follows:
①./NFS: Directories that are allowed to be accessed by other Computers (NFS folders are built first)
②. 192.168.1.*: The client IP address that is allowed to access the directory, this example indicates that the directory is accessible to all addresses of 192.168.1 for the first three segments of IP.
③. RW: Readable and writable
④. Sync: Synchronous Write Disk (async: Data is first staged in memory, not directly to the hard disk)
⑤. No_root_squash: Indicates that the client root user has write access to the directory.
5. Make the exports directory active and view the Active Directory. Use commands for:
Exportfs-a
6. Restart the NFS server. Use the command:
Service NFS Restart (if the CentOS 7.x uses the command: Systemctl restart NFS)
Note: If you can't start it, try starting it first.
Portmap use command: Service Portmap start; (If the CentOS 7.x uses systemctl start Rpcbind, the centos7.x name is changed)
Third, configure the client
NFS Configuration (CentOS)