One, NFS Master profile (default is empty):
/etc/exports
Format:
Shared directory share address 1 (parameter 1, parameter 2, ...) ) share address 2 (parameter 1, parameter 2, ...). )
Attention:
Local permissions for the shared directory, and if read-write sharing is required, make sure that the local directory is read and written by the user of the NFS client (nfsnobody)
Important Parameters:
RW Read and Write permissions
RO Read-only permissions
Async Async, Features: 1) fast, 2) risk of data loss
Sync Sync, Features: 1) slow, 2) data security
All_squash to suppress permissions as anonymous users
Anonuid,anongid specifying user uid and GID
Second, production skills
1. Ensure that all servers have the same permissions on the NFS shared directory
A, All_squash all the clients are compressed into anonymous users.
B, anonuid,anongid the specified UID and GID user
2, all clients and service side need to have a same UID and GID user, namely Nfsnobody
Service Management commands for NFS:
/usr/sbin/exportfs
/etc/init.d/nfs Reload equivalent to EXPORTFS-RV
EXPORTFS can share directories directly by command
/usr/sbin/showmount
View NFS Configuration and Mount conditions
/var/lib/nfs/etab
Record mount default parameters
Three, fault analysis ideas:
1) Check the network, port and firewall settings
2) Check that the server and client services are up and running
Iv. NFS Client Mount default values
Cat/proc/mounts
Five, optimize
1, disk selection, disk array configuration scheme
2, NFS server configuration parameters Optimization
All_squash,root_squash and other parameters used
3. Client Mount NFS Optimization scheme
CentOS 6.5 x86_64, parametric optimization
Nosuid,noatime,nodiratime,rw,noexec,hard,intr
4, the official kernel optimization
Vim/etc/sysctl.conf
Net.core.wmem_default = 8388608
Net.core.rmem_default = 8388608
Net.core.wmem_max = 16777216
Net.core.rmem_max = 16777216
Vi. Common commands for NFS services
# viewing server-side Mount information [[email protected]_client ~]# showmount -e 192.168.1.112export list for 192.168.1.112:/data 192.168.1.0/24# Reload Mount configuration [[email protected]_server ~]# exportfs -rvexporting 192.168.1.0/24:/ data# load shared configuration on the command line [[email protected]_server ~]# exportfs -o rw,sync 192.168.1.0:/data# View Rpcbind Service status [[email protected]_server ~]# rpcinfo -p localhost program vers proto port service 100000 4 tcp 111 portmapper 100000 3 tcp 111 portmapper 100000 2 tcp 111 portmapper 100000 4 udp 111 portmapper 100000 3 udp 111 portmapper 100000 2 udp 111 portmapper 100011 1 udp 875 rquotad 100011 2 udp 875 rquotad 100011 1 tcp 875 rquotad 100011 2 tcp 875 rquotad 100005 1 udp 39438 mountd 100005 1 tcp 48816 mountd 100005 2 udp 44018 mountd 100005 2 tcp 39398 mountd 100005 3 udp 53548 mountd 100005 3 tcp 59923 mountd 100003 2 tcp 2049 nfs 100003 3 tcp 2049 nfs 100003 4 tcp 2049 nfs 100227 2 tcp 2049 nfs_acl 100227 3 tcp 2049 nfs_acl 100003 2 udp 2049 nfs 100003 3 udp 2049 nfs 100003 4 udp 2049 nfs 100227 2 udp 2049 nfs_acl 100227 3 udp 2049 nfs_acl 100021 1 udp 56706 nlockmgr 100021 3 udp 56706 nlockmgr 100021 4 udp 56706 nlockmgr 100021 1 tcp 47320 nlockmgr 100021 3 tcp 47320 nlockmgr 100021 4 tcp 47320 nlockmgr
This article is from the "topspeed_king" blog, make sure to keep this source http://mylinuxlife.blog.51cto.com/4706737/1672088
Service Foundation and Optimization for NFS