Detailed steps for mounting NFS to other machines in CentOS

Source: Internet
Author: User

Detailed steps for mounting NFS to other machines in CentOS

Function to be implemented: Mount/share on 10.1.1.36 to/share on 10.0.1.31.

1. premise: There are two machines, both of which are centos 5.x systems.

Machine 1 IP: 10.1.1.36 (as the server, the NFS service and Portmap service must be enabled)
Machine 2 IP: 10.0.1.31 (as the client, the Portmap service must be enabled)

2. NFS and Pormap/rpcbind Installation

Whether it is portmap of 5.x or rpcbind of 6.x, the core functions are summarized as: Port ing.
Note: The Centos 6.x and later systems use rpcbind instead of Portmap.
Centos 5 installation:
Yum install nfs-utils portmap
Centos 6 installation:
Yum install nfs-utils rpcbind

The ERROR repomd. xml: [Errno 14] pycurl error 7-"couldn't connect to host" is not prompted for yum installation ",
Solution:
// Corrected the baseurl
[Root @ etl02 hdfs_13] # cat/etc/yum. repos. d/HDP. repo
HDP-2.0.6
Name = HDP
Baseurl = http://download.fedoraproject.org/pub/epel/5/?basearch
Path =/
Enabled = 1
Gpgcheck = 0

3. Mount steps

Follow these steps to mount the 10.1.1.36 shared path/share to 10.0.1.31 only:
Step 1,Machine 1 and IP 10.1.1.36 act as the server. The configuration required is as follows:

1) configure the/etc/exports file

[Root @ Processor036/] # cat/etc/exports
/Share 10.0.1.31 (rw, sync)

Description: shared path/share, which can be viewed as IP 31, supports rw read/write operations, and sync synchronization.

2) Start Portmap (Role: Port ing)
[Root @ Processor036/] # sudo/etc/init. d/portmap restart
Stopping portmap: [OK]
Starting portmap: [OK]

3) Start the NFS service
[Root @ Processor036/] # sudo/etc/init. d/nfs restart
Shutting down NFS mountd: [OK]
Shutting down NFS daemon: [OK]
Shutting down NFS quotas: [OK]
Shutting down NFS services: [OK]
Starting NFS services: [OK]
Starting NFS quotas: [OK]
Starting NFS daemon: [OK]
Starting NFS mountd: [OK]

4) display the shared directory (display the shared directory in/etc/exports of hostname)
[Root @ Processor036/] # showmount-e
Export list for Processor036:
/Share 10.0.1.31

Step 2,In machine 2, Mount/share of machine 1 (server side) to machine 2
The second/share below is the share path under the Local Machine 10.0.1.31. You need to manually create a new one.
[Root @ WEB-W031/] # mount-t nfs 10.1.1.36:/share
View:
[Root @ WEB-W031/] # cd/share
[Root @ WEB-W031 share] # ls-al
Total 16
Drwxr-xr-x 3 root 4096 Mar 14.
Drwxr-xr-x 32 root 4096 Mar 14 ..
Drwxr-xr-x 2 root 4096 Mar 14 running 36test

Refer:
Http://itoedr.blog.163.com/blog/static/120284297201371112828360 (very detailed portmap)

Author: Mingyi Tianxia
Reprinted please indicate the source, original address: http://blog.csdn.net/laoyang360/article/details/50917586
If this article is helpful to you, click 'ding' to support it. Your support is the greatest motivation for my persistence in writing. Thank you!

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.