NFS file server
What is NFS? What is the use?
NFS (Network File System) is a file server, he can through the network, so that different computers or different operating systems may file sharing, NFS allows shared network pc NFS server's directory is mounted to the side of the local file system in
NFS based on UDP / TCP protocol
NFS port used: 2049
rpcbind start of ports: 111
NFS there are other programs will be occupied by other port (default port less than 1024)
Log File Share resource: / var / lib / nfs / * the Tab
NFS configuration file locations: / etc / Exports
NFS started service items
rpc: Remote Procedure Call protocol, the protocol is to achieve a local call to a remote host implementations of system calls
portmapper: responsible for dispensing port rpc server and client when the client requests object rpc server responds back to the client terminal port, the working port 111 in the udp and tcp
mountd: a daemon authentication service nfs services, client upon receipt of a real return to port, the connection will go mountd, Certification token
nfsd: nfs daemon, responsible for after receiving a call request from a user makes a request to the kernel and get the result of the call in response to the user, work in tcp and udp port 2049 of
idmapd: NFS is a procedure, used after the rights issue is responsible for remote client-side to create a file
quotad: a disk quotas for implementing, when the client-side mount nfs can limit the amount of disk space
Configuration parameter file permissions
rw: readable and writable
ro: read-only
sync: synchronization data is written to memory and hard disk
async: temporarily saved to memory, not written directly to the hard disk
no_root_squash: When a client user using the root, the root user is mapped to the NFS
root_squash: When a client uses root user, mapped to the anonymous user's NFS
all_squash: NFS Login all users are anonymous users, that is, nobody
anonuid: anonymous users can set the value of UID
anongid: anonymous users can set the value of GID
Installation configuration NFS file services
Server
1. Install the software rpcbind and nfs-utils
yum install -y nfs-utils rpcbind
2. Create a shared directory and add required permissions
mkdir /public
chmod 777 /public
3. edit the configuration file / etc / exports
vim /etc/exports
/public 192.168.0.0/24(rw,sync,no_root_squash)
Supplementary: ip address can also use wildcards to replace the hostname
4. Start Services
service rpcbind start
service nfs start
Client
1. Install the software rpcbind and nfs-utils
yum install -y nfs-utils rpcbind
2. Mount the NFS server's shared file to a local directory created position
mkdir -p /mnt/test
mount -t nfs 192.168.0.101:/public /mnt/test
supplement:
View server shared resources: showmount -e localhost
-e: display a list of shared NFS servers
-a: display case situation NFS resource file resource native mount
-v: Display version
Remount: exportfs -arv
-a: All mount or uninstalled
-r: remount
-u: Uninstall a directory
-v: display the shared directory
Registration Status query RPC services: rpconfo -p localhost
-p: display all port and program information for an IP
-t: Check the software version of TCP packets for a program where a host of
-u: Check the software version of its UDP packets where a support program for a host of