Detailed steps for configuring nfs service in centos (enable nfs service in centos)

Source: Internet
Author: User
This article describes how to configure the nfs service in centos (enable the nfs service in centos). For more information, see CentOS.

Server Configuration
 
1. install nfs-utils and rpcbind

Copy codeThe code is as follows:
Yum install nfs-utils rpcbind

 
2. set the startup service

Copy codeThe code is as follows:
Chkconfig nfs on
Chkconfig rpcbind on

 
3. start Related services

Copy codeThe code is as follows:
Service rpcbind start
Service nfs start

 
4. create a shared directory

Copy codeThe code is as follows:
Mkdir-p/export/primary
Mkdir-p/export/secondary

 
5. edit the/etc/exports file and add the following content:

Copy codeThe code is as follows:
Vi/etc/exports
/Export * (rw, async, no_root_squash, no_subtree_check)

 
6. refresh the configuration to take effect immediately

Copy codeThe code is as follows:
Exportfs-

 
Client Configuration
 
1. install nfs-utils and rpcbind

Copy codeThe code is as follows:
Yum install nfs-utils rpcbind

 
2. set the startup service

Copy codeThe code is as follows:
Chkconfig nfs on
Chkconfig rpcbind on

 
3. start the service

Copy codeThe code is as follows:
Servicerpcbind start
Servicenfs start

 
4. create a mount point

Copy codeThe code is as follows:
Mkdir-p/mnt/primary
Mkdir-p/mnt/secondary

 
5. Mount Directory

Copy codeThe code is as follows:
Mount-t nfs server_ip:/export/primary/mnt/primary
Mount-t nfs server_ip:/export/secondary/mnt/secondary

 
6. view the mounted Directory

Copy codeThe code is as follows:
Df-h

 
7. unmount the mounted Directory

Copy codeThe code is as follows:
Umount/mnt/primary
Umount/mnt/secondary

 
8. edit/etc/fstab and mount it automatically upon startup.

Copy codeThe code is as follows:
Vi/etc/fstab
Server_ip:/export/primary/mnt/primary nfs rw, tcp, intr 0 1
Server_ip:/export/secondary/mnt/secondary nfs rw, tcp, intr 0 1

Related Article

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.