Network file system allow remote hosts to mount file systems throughout a network and interact with them as mounted locally.
There are two versions of nfs servers,
NFS 2 - old version, but widely supported
NFS 3 - new version - have variable file size handling and a good error reporting
By default when starting nfs server, the server uses, NFS 3
Nfs 2
====
NFS 2, uses UDP protocol for transmission of packets. As we know UDP protocol is stateless. It is not connection oriented. hence if the server goes down also the client will not know if the server is up or down. Without knowing this the clients keep on sending requests to the server.
In turn the packect get saturated in the network.
Hence it is good to use NFS 3
(Under normal conditions the transmissions via UDP protocol involves less traffic.)
Nfs 3
====
This Uses both TCP and UDP protocol to transmit data.
Lets go through an overview of process or steps happening with in the NFS server and client communication.
----------------------------------------------------------------------------------------------------------
step1: NFS client send an rpc request for accessing the shared directory by the NFS server
Step2: Server checks the rpc request and if the client is authorized, the server adds a cookie to the rpc came from client and send back to client.
Step3: Client on getting the reply from server get access to the shared directories provided by the nfs server.
(Note: cookie is just a random value stored on the serverside, it may also contain some authentication related data)
--> the nfs server provides privilleges to the remote hosts and not the users.
--> the server relies on rpc to route request between server and client.
***Note:The rpc services in linux are controlled by portmap service.
Packages required for a fully functional nfs server:
===================================
1. nfs
====
This package is required to start the rpc processes to service, requests for nfs file system from the clients.
2. nfslock
=======
This is an optional service provided by the nfs server. this enables to lock files on the server.
3. Portmap
========
This is the rpc service in Linux, it responds and sets up connection to the requested rpc services in the client.
When the server starts we need to check if the processes related with nfs server is running fine or not
for that we can use the ccommand
rpcinfo -p // command
----------
The important processes related with nfs server are:
-----------------------------------------------------
1. rpc.mountd:
--------------
When an rpc request comes from the client to the server for mounting, the rpc.mountd service accept the mount request and verifies if the requested filesystem is currently exported using the /etc/exports file
2. rpc.nfsd:
------------
This process meets the demands from the clients, providing server threads each time the client connects to the server.
3. rpc.statd:
-------------
This notifies remote hosts regarding the changes updated in the server while restarting the nfs service in the server side
4. rpc.quotad:
--------------
provides the quota information setup in the server for the exported directories.
=====================================================
Brief description regarding Portmap service functionalities:
------------------------------------------------------------
Portmap service, the name of the service itself tells us its functions.
It is nothing other than mapping the appropriate portnumbers to the request coming from the client machines, b mapping rpc request to the correct services.
Functions of portmap service on the ServerSide
-----------------------------------------------
Step 1:
--------
Starts the rpc processes and portmap service identify the processes are started.
Step 2:
-------
Each process reveals the portnumber they are monitoring and also the program number they are expecting to serve.
Functions of portmap service in the client side
------------------------------------------------
Step 1:
--------
Starts the rpc processes and identifies the prgram number for each process
Step2:
-------
The rpc requests Contacts the portmap service in the serverside with their corresponding portnumbers.
Step3 :
--------
On ther serverside the portmap service maps the program number to the suitable port number. and like that serves the rpc request coming from the client to server.
=============================================================================================================================================================
If we see a linux box's CPU utilization is more due to the nfs server process load,
------------------------------------------------------------------------------------
We can just refresh the server setup like
rpc.nfsd 0 --> this will temporarily stop all standard rpc requests
Courtesy: MeenuKutty(SystemAdmin GTS)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment