NFS (Network File System) a network file system that allows computers in a network to share resources across TCP/IP networks. In an NFS application, a local NFS client application can transparently read and write to files located on the remote NFS server, just as you would access a local file. taking CentOS6 as an example
For service-side
Preferred check if the corresponding software is installed
Rpm-aq nfs-utils Rpcbind
Install NFS if not installed install it here with Yum
Yum Groupinstall "NFS fileserver"-y
Preferred to start the RPC service after installation is complete
/etc/init.d/rpcbind start
Start the NFS service
/etc/init.d/nfs start
Set up RPC and NFS services on boot
Chkconfig NFS Onchkconfig Rpcbind on
Edit NFS Profile Share out folder
Vim/etc/exports
#shrared/data Test
/data 192.168.0.0/24 (Rw,sync)
#共享/data folder in 192.168.0.0/24 segment RW is read and Write permission sync is writing data from buffer to disk
Check the shared results
SHOWMOUNT-E localhost
Export list for localhost:
/data 192.168.0.0/24
OK then configure the/data folder permissions to NFS read and write
Chown-r Nfsnobody.nfsnobody/data
For client
Client needs to install RPC service
Yum Install Rpcbind-y
Start the RPC and set the boot-on self-boot
/etc/init.d/rpcbind Startchkconfig Rpcbind on
Check to see if the server can be accessed
SHOWMOUNT-E 192.168.0.151
Export list for 192.168.0.151:
/data 192.168.0.0/24
Mount NFS to a local folder
Mount-t NFS 192.168.0.151:/data/share
Execute df-h and you'll see.
Filesystem Size used Avail use% mounted on
/dev/sda3 18G 2.1G 15G 13%/
Tmpfs 491M 0 491M 0%/dev/shm
/DEV/SDA1 190M 98M 83M 55%/boot
192.168.0.151:/data 72G 1.4G 67G 3%/share
This article is from the "crazy Young と Small World" blog, please be sure to keep this source http://hoshizora.blog.51cto.com/11765507/1825288
Creation of NFS Network File system