tech:serveur_nfsv3_et_montage_client
Table des matières
Serveur NFS v3 et montage client
Sur le serveur
- /etc/exports
/data/plop machine1(async,rw,no_root_squash)
exportfs -rv
Si besion
chmod 1777 /data/plop
Sur le client
- /etc/fstab
serveurnfs:/data/plop /import/plop nfs defaults,_netdev,nfsvers=3 0 0
rw,bg,hard,rsize=32768,wsize=32768,tcp,vers=3,timeo=600
mkdir -p /import/plop mount /import/plop
Mount options
nocto: Suppress the retrieval of new attributes when creating a file. noac: Disable all forms of attribute caching entirely. This extracts a significant performance penalty but it allows two different NFS clients to get reasonable results when both clients are actively writing to a common export on the server. noacl: Disables Access Control List (ACL) processing. vers=4.1: NFS v4.1 should be used instead of v4.0 because there is a Linux NFS client bug in v4.0 that can cause significant problems due to stale data. nofail: Don't halt boot process waiting for this mount to become available lookupcache=positive: Tells the NFS client to honor positive cache results but invalidates any negative cache results. Negative cache results cause problems with Git. Specifically, a git push can fail to register uniformly across all NFS clients. The negative cache causes the clients to 'remember' that the files did not exist previously.
Test
Supervision
Voir aussi :
- check_mk
- fsfreeze (Linux Ext3/4, ReiserFS, JFS, XFS)
Le plus simple pour monitorer NFS étant de créer un fichier de le l'effacer https://docs.netapp.com/us-en/ontap/nfs-config/test-access-client-systems-task.html
stat -f (system call statfs(2)
If the NFS mount is “stale”, then stat -f returns immediately but with a size of -1. The check detects that and results in a warning state.
mount -l | grep nfs grep nfs /proc/mounts nfsstat nfsstat --mounts mountpoint -q /mnt/foo findmnt -rno SOURCE,TARGET "$1" lsof -b ss -a|grep :nfs
mountpoint="/mnt/testnfs" #read -t1 < <(stat -t "$mountpoint" 2>&-) read -r -t1 < <(stat -t "$mountpoint" 2>&-) if [ -z "$REPLY" ] ; then echo "NFS mount stale. Removing..." fi
tech/serveur_nfsv3_et_montage_client.txt · Dernière modification : de 127.0.0.1
