NFS Network File System C/S
rpc 111 remote procedure call mechanism
S: set a shared directory
C: mount Use this shared directory to mount
Server
yum -y install nfs-utils rpcbind //Install nfs and rpc
[[ email protected] ~]# mkdir /data//Create a public folder
[[emailprotected] ~]# vim /etc/exports //Modify the configuration file
[[email protected] ~]# cat /etc/exports
/data 192.168.2.0/24(rw) // Allowed network segments and permissions to be viewed
[[email protected] ~] # systemctl start rpcbind //Remember to start the rpc service first. Start nfs
[[emailprotected] ~]# systemctl enable rpcbind
[[emailprotected] ~]# systemctl start nfs
[[emailprotected] ~]# systemctl enable nfs
Client
[[emailprotected] ~]# yum -y install nfs-utils //You don’t need to install nfs but install this for the showmount command
[[emailprotected] ~]# showmount -e 192.168.2.30 //The IP address of the server
[[email Protected] ~]# mount 192.168.2.30:/data /opt/ /// opt is the mount point You can find the files shared by the server in it
[[email protected] ~] # vim /etc/fstab
192.168.2.30:/data / opt nfs defaults,_netdev 0 0
/var/ftp/ is the shared root directory and can be shared