The Construction of NFS service and RPC protocol

Source: Internet
Author: User

The abbreviation for the NFS (Network File system), which means the web filesystem. The main function is to share directories or files between different hosts through the network. NFS Clients mount the NFS server-side shared data directory to the local system by mounting it. Due to the many features supported by NFS, different functions will start different ports to transfer data, because the port is not fixed will cause NFS client and NFS server-side communication barrier, in order to solve this problem, there is the RPC (Remote Procedure call) service. RPC is a remote call protocol that corresponds to a bridge between NFS client and NFS server-side data transfer.

In this paper, the NFS service between two Linux hosts to achieve data transfer, the specific operation is as follows:

1, the Linux host version in this article is Centos6.5, the specific information is as follows

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/82/7A/wKioL1dWfwfC6N4hAAAjKVv0RmI020.png-wh_500x0-wm_3 -wmp_4-s_768455521.png "title=" 1.png "alt=" Wkiol1dwfwfc6n4haaajkvv0rmi020.png-wh_50 "/>

2, download the relevant software nfs-utils, Rpcbind (in Centos5.8 the name of this software is Portmap)

Yum Install nfs-utils rpcbind-y

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/82/7A/wKioL1dWgFCgfkXVAAAUgIOB8SE054.png-wh_500x0-wm_3 -wmp_4-s_3778025002.png "title=" 2.png "alt=" Wkiol1dwgfcgfkxvaaaugiob8se054.png-wh_50 "/>

3, start nfs-utils and rpcbind, you need to note that you must start the Rpcbind, and then start the NFS-UTILS,NFS service may

Normal work,

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/82/7B/wKiom1dWgG6iKvkJAABaYKGiBRA830.png-wh_500x0-wm_3 -wmp_4-s_2037726428.png "title=" 3.png "alt=" Wkiom1dwgg6ikvkjaabaykgibra830.png-wh_50 "/>

4. File configuration/etc/exports write NFS configuration information. For the sake of simplicity in this article, the server-side shared directory is

/home/data, the network segment is 192.168.1.*, the shared directory can read and write, synchronously write to disk. You can also view the server's internal default configuration information at this time

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/82/7A/wKioL1dWgtKwp1-yAAAL3IAQJJw038.png-wh_500x0-wm_3 -wmp_4-s_426623230.png "title=" 4.png "alt=" wkiol1dwgtkwp1-yaaal3iaqjjw038.png-wh_50 "/>650" this.width=650; "src = "Http://s2.51cto.com/wyfs02/M00/82/7B/wKiom1dWgtuCNDayAAAdPvv_EnM120.png-wh_500x0-wm_3-wmp_4-s_3800283801.png "Title=" 6.png "alt=" Wkiom1dwgtucndayaaadpvv_enm120.png-wh_50 "/>

5, change the owner of the shared directory, view the default configuration information you can know that the NFS service client logon user defaults to anonymous users. The shared directory permissions after the change are as follows:

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/82/7B/wKiom1dWhAjB5EyMAAAROc2cGzY305.png-wh_500x0-wm_3 -wmp_4-s_3398058384.png "title=" 5.png "alt=" Wkiom1dwhajb5eymaaaroc2cgzy305.png-wh_50 "/>

6. The showmount-e localhost command allows you to see if the NFS service is functioning properly. After normal, the shared directory can be mounted on the NFS client.

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/82/7B/wKioL1dWhfLg30JyAAAfAX7P5zI852.png-wh_500x0-wm_3 -wmp_4-s_2174506022.png "title=" 1.png "alt=" wkiol1dwhflg30jyaaafax7p5zi852.png-wh_50 "/>650) this.width=650;" Src= "http://s2.51cto.com/wyfs02/M01/82/7C/wKiom1dWhYGiRomaAAAbuAxa4JY039.png-wh_500x0-wm_3-wmp_4-s_2478103209. PNG "title=" 2.png "alt=" Wkiom1dwhygiromaaaabuaxa4jy039.png-wh_50 "/>

7. The client is mounted via the Mount command.

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/82/7B/wKioL1dWh1iRpWaaAAAV7MZFBqw377.png-wh_500x0-wm_3 -wmp_4-s_3768186024.png "title=" 1.png "alt=" Wkiol1dwh1irpwaaaaav7mzfbqw377.png-wh_50 "/>

At this point, a simple NFS service is set up, it should be noted that the server-side shared directory must exist, second, if you want to boot NFS service can use Chkconfig, or write the start command to/etc/ Rc.local Script (note start NFS after starting Rpcbind), while the client wants to mount the shared directory (start the Rpcbind service first) can write the Mount command to/etc/fstab or/etc/rc.local, but the recommendation is to write/etc/ Rc.local script.

This article is from the "Wind and Drift" blog, please be sure to keep this source http://yinsuifeng.blog.51cto.com/10173491/1787018

The Construction of NFS service and RPC protocol

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.