Saturday, February 27, 2010

Everything On NFS

The Network File System (NFS) is used to distribute filesystems over a network. The server exports the filesystem and the client imports it. There are now two ways to run a NFS server. The traditional method is by running the user space NFS daemon. The newer option is the kernel based kernel-nfsd, which was introduced with kernel version 2.2. SuSE supports both methods. The user space daemon has built a reputation for reliability, but has limitations in terms of speed. The kernel based NFS daemon is faster, but not as well tested as the older one.


Step By Step Configure NFS server and NFS client:
====================================

NFS server setup:
------------------------------

#rpm –Uhv nfs-utils-0.3.1-13.i386.rpm

-------
#vi /etc/exports
/home   192.168.0.0/24(rw,no_root_squash,anonuid=500,anongid=100,sync)

-------

verify:
-----------
# /usr/sbin/exportfs –a
# showmount    -ad


NFS client setup:
----------------------------

#mount –t nfs compaq:/export /mnt/nfs

-------
#vi /etc/fstab
hostA:/export /mnt/nfs mfs soft 0 0
-------


Automount NFS & Setting which uses NIS:
================================

#rpm -Uhv autofs-3.1.7-28.i386.rpm

------------
#vi /etc/auto.master
/nfs /etc/auto.home --timeout 60
-------------

---------------
#vi /etc/auto.home
home -rw,hard,intr,nolock compaq:/home
--------------

--------------
#vi /var/yp/Makefile
all: passwd group hosts rpc services netid protocols mail \
shadow auto.home \
--------------
cd /var/yp
make

Verify:
----------
# ypcat auto.home
-rw,hard,intr,nolock compaq:/home





Important Commands:
=================

*   mount -t nfs

*   rpcinfo     [information about the RPC service that is running on a system]
*   showmount -a (on the server)      [Number of connection]
*   showmount -e [Displays a list of exported directories.]
*   netstat -s       [fragmentation  socket buffers]
*   nfsstat -cr
*   nfsstat [ -cmnrsz ]
  pstack [This command displays a stack trace for each process. ]

      /usr/bin/pgrep nfsd

      /usr/bin/pstack PID

      /usr/sbin/dtrace -Fs       
      startsrc -s biod
      /usr/sbin/exportfs -v
      /usr/bin/rusers  [Remote Users]

*   tracepath
*   snoop       [This command is often used to watch for packets on the network.]
*   truss        [You can use this command to check if a process is hung.]




Directories & Files:
===============
/etc/exports
#  /var/lib/nfs/rmtab
#  /etc/rmtab      [    Contains information about the current state of all exported directories.]
#  /etc/xtab   [Lists currently exported directories.]
/etc/fstab


Process & Daemons:
=======================

Daemon                                   Description
--------------------                        ---------------------
*** nfsd ->           The NFS daemon which services requests from the NFS clients.
*** mountd ->     The NFS mount daemon which carries out the requests that nfsd passes on to it.
*** rpcbind ->     This daemon allows NFS clients to discover which port the NFS server is using.

rpc.mountd — The running process that receives the mount request from an NFS client and checks to see if it matches with a currently exported file system.
 
*    rpc.nfsd — The process that implements the user-space components of the NFS service. It works with the Linux kernel to meet the dynamic demands of NFS clients, such as providing additional server threads for NFS clients to use.

*    rpc.lockd — A daemon that is not necessary with modern kernels. NFS file locking is now done by the kernel. It is included with the nfs-utils package for users of older kernels that do not include this functionality by default.

*    rpc.statd — Implements the Network Status Monitor (NSM) RPC protocol. This provides reboot notification when an NFS server is restarted without being gracefully brought down.
 
*    rpc.rquotad — An RPC server that provides user quota information for remote users.
 



NFS:
====

http://docstore.mik.ua/orelly/networking_2ndEd/nfs/
http://docs.sun.com/app/docs/doc/819-1634/rfsrefer-45?a=view
http://docs.sun.com/app/docs/doc/819-1634/rfsadmin-215?a=view
http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/ref-guide/ch-nfs.html
http://www.linux.org/docs/ldp/howto/NFS-HOWTO/server.html



NFS Performance Tuning:
====================

http://www.ncsa.illinois.edu/UserInfo/Resources/Hardware/IBMp690/IBM/usr/share/man/info/en_US/a_doc_lib/aixbman/prftungd/2365ca3.htm
http://tldp.org/HOWTO/NFS-HOWTO/performance.html


Commands :
==========

http://docs.sun.com/app/docs/doc/819-1634/rfsrefer-37?a=view
http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/index.jsp?topic=/iphcg/showmount.htm
http://www.regatta.cs.msu.su/doc/usr/share/man/info/ru_RU/a_doc_lib/cmds/aixcmds5/aixcmds502.htm#ToC


Configuration:
===========
http://www.labtestproject.com/linnet/index.html
http://highervisibilitywebsites.com/step-step-set-nfs-share
http://www.freebsd.org/doc/handbook/network-nfs.html
http://www.troubleshooters.com/linux/nfs.htm

 

No comments:

Post a Comment

 Linux Interview  Linux booting process EXT4 XFS file system runlevel scan disk hba driver systool -c fc_host lspci -nn | grep -i hba single...