Sunday, August 23, 2009

NFS Tips & Tricks

  • The usual issue found with the NFS mount points is the performance issue faced when a NFS mount is used. The system stalls even when a 'Is' command is issued inside the NFS mount point. This is because, the NFS is hard mounted, which is usually done with the default settings.
  • NFS, by default, does not permit the files owned by root user/group to be owned by root user/group in the NFS client mount. This can be fixed by using the no_root_squash option in the /etc/exports file in the NFS server.
Considering the above two cases, a better situation can be arrived at if it is soft mounted using the below options.

NFS Server side configurations:

In the file /etc/exports use the below entry format

In the file /etc/sysconfig/nfs provide the below entry RPCNFSDCOUNT=64

"The above value 64 can be decreased for a lower Hardware and network bandwidth. It can be changed based on the project requirements.

NFS Client side configurations:

: nfs soft,intr,proto=tcp,timeo=14,retry=3,bg,rsize=65536,wsize=65536 0 0
  • NFS usually maps the uids/gids owned by the files or folders in the NFS server to a user or a group that has the same uid or gid in the client box. Hence whenever NFS mount points are used, the user using the files or folders that are created in the NFS share, should have the same uid in all the boxes [the NFS client boxes and NFS server] that share the files or folders through NFS.
Similarly, the group too must have the same gid, in all the boxes.
  • In NFS4, when starting the NFS service in the NFS server, if you face an error saying RPC.IDMAPD not found, add the below entries in the /etc/fstab in the NFS server to avoid such error and improve performance and run the command mount -a as root.


nfsd /proc/fs/nfsd nfsd defaults,noatime 1 1
rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs defaults 0 0

Thanks
A.T.J

No comments:

Post a Comment