NFS, a networked file system (network filesystem) 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.
Build NFS Services under Linux
In general, the CentOS default installation, the installation package is Nfs-utils, you can start the service directly
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5B/66/wKiom1UH2XeSSYUtAADcImg0dWs411.jpg "title=" Capture 1. PNG "alt=" Wkiom1uh2xessyutaadcimg0dws411.jpg "/>
Practical case: Server 192.168.157.142 client 192.168.157.148
Server-Side shared directory/test client mount the directory
Editing a configuration file
Vi/etc/exports
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5B/62/wKioL1UH70PQScFgAABWEN-Qglk354.jpg "title=" Capture 3. PNG "alt=" Wkiol1uh70pqscfgaabwen-qglk354.jpg "/>
Permissions for NFS are described here
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5B/68/wKiom1UH7kKAZv9nAAPNuZpsDb4630.jpg "title=" Capture 2. PNG "alt=" Wkiom1uh7kkazv9naapnuzpsdb4630.jpg "/>
Use commands when editing is complete
EXPORTFS-RV enabled
Restart NFS Service
Use the command showmount-e 192.168.157.142 to view
The client can mount with mount command mount
Mount-t NFS 192.168.157.142:/test/mnt/share
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5B/68/wKiom1UH7yig__eEAADBQUl-9Oo197.jpg "title=" Capture 4. PNG "alt=" Wkiom1uh7yig__eeaadbqul-9oo197.jpg "/>
Description Mounted successfully!
In the middle there is a problem:
[Email protected] ~]# showmount-a 192.168.157.142
Mount Clntudp_create:RPC:Port Mapper failure-rpc:unable to receive
Simple workaround: Turn off Firewall service iptables stop
Question two:
[Email protected] ~]# mount-t NFS 192.168.157.142:/test/mnt/share
Mount:192.168.157.142:/test failed, reason given by Server:permission denied
The cause may be a problem with the server-side profile exports shared host.
In addition, the client can set the boot automatically mount, the method is as follows:
Vi/etc/fstab
192.168.157.142/test/mnt/share NFS Ro (permissions) 0 0
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5B/68/wKiom1UH8TyAw5BWAAEnp-ZcSg4262.jpg "title=" Capture 5. PNG "alt=" Wkiom1uh8tyaw5bwaaenp-zcsg4262.jpg "/>
This article is from the "Filter New" blog, please be sure to keep this source http://wahehe.blog.51cto.com/8935316/1621531
Configuration and use of NFS under Linux