|
CentOS 7 installation and configuration
surroundings
Nps 192.168.1.97
Client 192.168.1.98
First, yum installation
Yum -y install nfs-utils rpcbind
Nfs configuration file / etc / expots
The default is empty
Vi / etc / exports
/ Opt / test / 192.168.1.0/24 (rw, no_root_squash, no_all_squash, sync, anonuid = 501, anongid = 501)
Second, make the configuration effective
Exportfs -r
Note: The configuration file description:
/ Opt / test is the shared directory
192.168.1.0/24 can be a network segment, an IP, it can be a domain name, domain names, such as support: * .qq.com
Rw: read-write, can read and write;
Ro: read-only, read-only;
Sync: the file is written to the hard disk and memory;
Async: file temporarily stored in memory, rather than directly into memory;
No_root_squash: NFS client to connect to the server if the use of the root, then the server to share the directory, it also has root privileges. It is obviously not safe to turn on this.
Root_squash: NFS client to connect to the server if the use of root, then the server to share the directory, with anonymous user privileges, usually he will use nobody or nfsnobody identity;
All_squash: regardless of the NFS client to connect the server to use when the user, the server share directory is to have anonymous user privileges;
Anonuid: Anonymous user's UID value, can be set here.
Anongid: GID value of the anonymous user.
Third, start nfs
Service rpcbind start
Service nfs start
Chkconfig rpcbind on
Chkconfig nfs on
Fourth, the client mount:
Showmount -e 192.168.1.97 # View can be mounted
Export list for 192.168.1.97:
/ Opt / test 192.168.1.0/24
The client mounts
Mount -t nfs 192.168.1.97:/opt/test/mnt
Silent is both successful
Client encountered in the loading of a problem is as follows, the network may be less stable, NFS default is to use UDP protocol, replaced by TCP protocol can be:
Mount -t nfs 192.168.1.97:/opt/test/mnt -o proto = tcp -o nolock |
|
|
|