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;
Ii. Dependent Services and packages
1. Check if the following two packages have been installed (both packages are already installed by default when the Rhel or CentOS system is installed)
rpm-qa nfs-utils rpcbind
Or
Rpm-qa|grep "Nfs-utils|rpcbind" [less efficient than the former]
2. If not installed, install them now
Yum Install nfs-utils rpcbind-y
Three. Start
/etc/init.d/rpcbind Start
/etc/init.d/nfs start
Note:
1./etc/init.d/nfs Reload equivalent to Exports-r
rpcinfo-p localhost visible RPC information
Four. Configuration
Vi/etc/exports
/data 192.168.120.* (Rw,sync)
Cat/var/lib/nfs/etab
anonuid=65534,anongid=65534
Nfsnobody:x:65534:65534:anonymous NFS User:/var/lib/nfs:/sbin/nologin
To view the configuration:
SHOWMOUNT-E 127.0.0.1
Five. Running
Mount-t NFS 192.168.120.143:/data/mnt
Six. Run Rpcbind on other clients
Mount-t NFS 192.168.120.143:/data/mnt
Seven. On the client and server side
Vi/etc/rc.local
>/etc/udev/rules.d/70-persistent-net.rules
/etc/init.d/rpcbind start
/etc/init.d/nfs start
Mount-t NFS 192.168.120.143:/data/mnt
CentOS Shared server with NFS