NFS Network File System Introduction

Source: Internet
Author: User

NFS Introduction to Network File system

    • What is NFS system?

NFS is the abbreviation for the network file system , and its main function is to allow files and directories to be shared between different machine systems through the Web.
The NFS server can allow NFS clients to mount the shared directory on the remote NFS server side to the local NFS client. (Note that NFS clients are typically application servers such as:Web)

the NFS server-side shared directory is the same as the NFS client's own disk partition and directory.

General client mount to the local directory name can be casual, but for easy management, the recommendation and the server side is as good.

NFS is generally used to store shared video, images and other static data (for users to upload files are stored in the NFS share, images, video), is the current Internet system architecture is one of the most commonly used data storage services, especially small and medium-sized companies are very high frequency application. (Note Large company or portal use:mfs,gfs fastfs, distributed System)

  • NFS mount structure diagram
    650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/89/CD/wKioL1gdj5Oi57FWAAEfH-gZVZ8618.jpg "title=" Nfsgz.jpg "alt=" Wkiol1gdj5oi57fwaaefh-gzvz8618.jpg "/>
    1, The content of the client/data/shard directory is preferably empty, or will not be temporarily found after Mount
    2, the client to be able to store the file successfully must have the server to open the permissions to share files
    3, the client local hold the time, also has the permission to set

  • NfsA detailed introduction to the mounting principle
    when we are inNfsserver-side setup good shared storage directory/data/shardthe other has access to theNfsServer-SideNfsThe client can place this server on the/data/shardshare directory, mount toNfsA mount point on the client's local system (which is actually a directory, which can be arbitrarily specified), in twoNfsThe local mount point of the client is/data/shard,
    when the correct mount is complete, enter the specifiedNfsClient-side/data/sharddirectory, you can seeNfsServer-Side/data/shardshare out all the data under the directory, almost feel no difference, according toNfsthe service-side grantsNfsshare permissions, as long as the specifiedNfsClient Operation Mount Point/data/sharddirectory, you can easily access the data to theNfson the server side/data/shardin the catalog

    MountNfsafter theNfsthe client-side local mount content is displayed as follows, using the command:Df–H
    to view the Mount details command on the client:Cat/proc/mounts
    See mount default parameters on server side: Use command:Cat/var/lib/nfs/etab

    Nfsis the transfer of data between the server and the client over the network. The transfer of data between the two will have to be the corresponding network port for transmission. NfsWhat network port does the server use to transfer data,Nfsthe server is actually randomly selecting ports for data transfer. ThatNfsHow does the client knowNfsWhat port does the server end up with? ActuallyNfsThe server is called through a remote procedure call (Remote Procedure CallabbreviationRpc) Protocol/services to achieve. Which meansRpcservices are managed uniformlyNfsport, client and server through theRpcto communicate first.Nfswhich ports are used, and then use those ports (less than1024) for data transfer.

    (Note: The original isRpcmanage the service-sideNfsport assignment, the client wants to pass the data, the client'sRpcwill be first with the serverRpcgo to the port of the server, make a connection to the port, and then transfer the data)

    thisRpcapplication of the service in portal-level websites everywhere, (Baidu)

  • theRpcwith theNfs"
    Rpc(note incentos5.xinside the system isPortmapServices,centos6.xinside the system isRpcbindservice) is used for unified managementNfsports, and the unified external ports are111. Nfsserver needs to start firstRpc, and then startNfs, soNfsto be able toRpcto register port information. Client-sideRpccan be passed to the service-sideRpcrequest to get the service-sideNfsPort information. When it gets to theNfsport information, the data is transferred to the actual port. (AsNfsthe port is random. )

  • theRpcand theNfsHow to Communicate "
    becauseNfsThere are many functions, different functions need to use different ports. SoNfsUnable to pin the port. andRpcwill recordNfsPort information so that we can pass theRpcimplement the server and clientRpcto communicate port information.

    thatRpcand theNfsand how do they communicate with each other?
    First, whenNfsonce started, some ports are used randomly, and thenNfswill be toRpcto register these ports. Rpcthese ports are logged. andRpcwill boot111port, waiting for clientRpcrequest, if the client has a request, the serverRpcit will record theNfsThe port information informs the client.

    tip: When you startNFS SERVERbefore you begin, startRpcServices (i.e.PortmaporRpcbindService, hereinafter) otherwiseNFS SERVERwill not be able toRpcService Area Registration, in addition, ifRpcService restarted, the original is already registered goodNfsThe port data is all lost. So at this pointRpcof service ManagementNfsThe program also needs to be restarted to re-Rpcregistration. Special Note: General modificationsNfsafter configuring the document, no restart is requiredNfs, directly in the command execution/etc/init.d/nfs ReloadorExportfs–Rvyou can make the modified/etc/exportseffective.

    (Note:here is a starting point of the order, first of all to tell you clearly. BecauseNfswant toRpcRegister port information. SoRpcbe sure to precedeNfsstart early. I give you the analogy of a left-hand stack of right-handed games, at this point is sure to ensure thatNfsThe palm of the hand (left) inRpcthe top of the palm (right). The normal order is toRpcfold it up first, and thenNfsfold it up again. IfRpcRestart , it is the same as the palm of the hand out, and then re-fold up. ThisRpcjust inNfsup there, so no. At this time, ourNfsit needs to be restarted again. ThisNfsafter pulling it out and then stacking it up,Nfsjust inRpcup there. IfNfsIf you modify the configuration, you can directlyReloadjust fine.)

  • client nfs and server-side nfs first server-side start rpc service, and turn on 111 port
    2, start Nfs register port information
    3, client-initiated rpc ( portmap service), to the server-side RPC ( Portmap) Nfs port
    4 service feedback nfs Port information to the client.
    5, the client obtains the nfs port to establish and service-side nfs connect and transmit data.

  • Client NFS and server-side NFS communication process Flowchart
    650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/89/CD/wKioL1gdj7Gis4vtAALXvFRSXnU912.jpg "title=" 456456456.jpg "alt=" Wkiol1gdj7gis4vtaalxvfrsxnu912.jpg "/>





This article is from the "12132662" blog, please be sure to keep this source http://12142662.blog.51cto.com/12132662/1869796

NFS Network File System Introduction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.