NFS essays

Under normal circumstances the windows network shared with samba user LAN network share.
Internet sites for small and medium NFS cluster architecture common back-end data sharing.
Large sites will use more complex Moosefs (mfs) (small files) GlusterFS (large file) FastDFS ( small files). Do it yourself

Three main services rpc.nfs rpcbind rpc

Server
1.yum install -y nfs-utils nfs-nobody created automatically

2. Open the boot join rpcbind nfs open
rpcinfo -p View service nfs rpc registered by the main port of 2049

Configuration file / etc / Exports
/ var / lib / NFS / server configuration Etab

Client CAT / proc / mounts
DF -H sometimes stuck to use the above method

/ etc / exports configuration instructions
directory of the target (RW, the all_squash, (the async, Sync), the anonuid = XX, XX anongid =)
/ etc / exports / var / Share 192.168.0. * (RW, Sync, the root_squash)
/ etc / exports / var / share 192.168.0.0/24(rw,sync,all_squash,anonuid=65534,anouid=65535)

useradd -s /sbin/nologin -M

If users do use a visit, just all_squash all users compressed into an anonymous user, and to specify the anonymous user UID GID.
In NFS, the only recognized UID, and the actual name does not matter, but in order to unify, are set to UID and user name as the user
nfs problem
if multiple clients to nfs server co-management of resources, these three uid to be the same, otherwise it will go wrong
all_squash root_squash no_root_squash anonuid = anongid = which is to ensure both consistent

Large concurrent use async normal sync

4.exportfs -avr update nfs directory do not need to restart the service
exportfs -avu not need to restart services close nfs
exportfs view shared open

Client

  1. showmount -e 172.16.1.31 view of the shared directory server
  2. -t nfs 172.16.1.31:/home testnfs Mount
    umount -lf forced uninstall is not recommended

fstab mount 192.168.0.6 / database nfs default 0 0

firewalld need to release three service rpcbind mountd nfs (the pit too!)

NFS optimization
1. Disk RAID card throughput of the bind
2.NFS Exports Configuration
3. Mount commands to optimize
4./etc/sysctl.conf kernel optimization

NFS Limitations
1. single point of failure
2. The performance is limited, but can greatly reduce the NFS cache access
3. plain, non-redundant
high coupling 4, hang directly stuck

Guess you like

Origin blog.51cto.com/14316149/2416885