first, the Concept of NFS
NFS (Network file system/Network File system):
1. Set up file sharing between Linux systems (using Samba services for file sharing between Linux and Windows);
2, NFS is only a file system, itself does not have the transmission function, is based on RPC protocol to achieve, to achieve two Linux system file directory sharing;
3, NFS for C/S (client/server) architecture;
Second, server-side configuration
1. configuration file
The main configuration file is:/etc/exports
The format is: The shared directory can mount host IP (parameter 1, parameter 2, ...). )
such as:/var/nfs 172.20.*.* (rw,sync,all_squash,anonuid=65534, anongid=65534)
Note: You must pay attention to the nfs/directory access, must be set to 777 permissions, the parent directory/var permissions are not required, ordinary 755 can;
2, start related services, and then start related services: Portmap, Nfslock, NFS
3, check the shared directory, then you can take a look at the showmount–e, to see the shared directory situation:
[Root@ns var]# Showmount-e
Export list for ns.osserver:/var/nfs 172.20.*.*
OK, so far, NFS server has been built;
Third, client configuration
1. Ensure Portmap operation
The client must ensure that the RPC protocol corresponds to the Portmap normal operation, or the mount will fail;
2, Mount/var/nfs directory (local mount point for/mnt/nfs)
Mount-t NFS 172.20.65.16:/var/nfs/mnt/nfs
After successful mount, can be as free as the local directory operation;
Iv. other relevant orders
1, when the/etc/exports file has been modified, you can not restart the NFS service, directly using the EXPORTS–RV can be used to re-export the shared directory;
The command format is as follows: Exportfs [-aruv]
-A: All the contents of Mount or Unmount/etc/exports
-R: Re-mount/etc/exports the shared directory
-u:umount Directory
-V: In export, the detailed information will be exported to the screen.
Concrete example: [Root@ns var]# SHOWMOUNT-E
Export list for ns.osserver:/var/nfs 172.20.*.*
[Root@ns var]# Exportfs–au #全部卸载
[Root@ns var]# Showmount-e
Export list for ns.osserver: [Root@ns var]# exportfs–rv #全部重新 Export Once
Exporting 172.20.*.*:/var/nfs
[Root@ns var]#
2, showmout Command for NFS operation and error-checking has a lot of help, so we first look at the use of showmount
Showmout
-A: This parameter is typically used on NFS server and is used to display Cline machines that have been mount on the native NFS directory.
-E: Displays the catalog that is export from the specified NFS server.
For example: [Root@localhost ~]# showmount-e 172.20.65.16
Export list for 172.20.65.16:/var/nfs 172.20.*.*
[Root@ns var]# Showmount-a
All mount points on Ns.osserver:172.20.*.*:/var/nfs
v. FAQ
1. Tip: Mount to NFS server ' 172.20.67.203′failed:server are down.
Solution: There may be a problem with the firewall for the NFS server;
2, Hint: mount:RPC:Timed out
Solution: Because RPC protocol is not running, start Portmap service;
There may also be a firewall problem; server/client is possible.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service