Install and configure the NFS server in centos 6.5

Source: Internet
Author: User

OS: centos 6.5

Server: 10.1.11.201

Client: 10.1.11.202 10.1.11.203 10.1.11.204

1. Server Configuration

Install the required Yum package:

yum -y install nfs-utils rpcbind

Create a shared directory:

mkdir /Udisk

Edit/etc/exports. Note that there is no space between the IP address and the permission Configuration:

cat /etc/exports/Udisk 10.1.11.202(rw,sync,root_squash)/Udisk 10.1.11.203(rw,sync,root_squash)/Udisk 10.1.11.204(rw,sync,root_squash)

Start the service and set startup

service rpcbind startservice nfs startchkconfig --level 2345 rpcbind onchkconfig --level 2345 nfs on

2. Client Configuration

Install the required Yum package:

yum -y install nfs-utils rpcbind

Create directory:

mkdir /Udisk

View the directory shared by the server:

showmount -e 10.1.11.201

Mount the shared directory to the local device and test read/write:

mount -t nfs 10.4.15.71:/Udisk /Udiskcd /Udisk && touch a

Set automatic mounting upon startup:

vi /etc/fstab10.1.11.201:/Udisk     /Udisk                    nfs     defaults        0 0

 

Description of read/write configuration parameters in the/etc/exports file (derived from the http://www.zhukun.net/archives/7096)

RW: read-write, which can be read and written;
RO: Read-only, read-only;
Sync: Synchronous writing (writing files to hard disks and memory at the same time), suitable for scenarios with frequent communications and high real-time performance
Async: asynchronous write (the file is written to the memory first, and then to the hard disk later). It has good performance (FAST) and is suitable for writing ultra-large or ultra-large files, but has the risk of data loss, such as sudden power failure;
Note: Unless otherwise required, async is not recommended. If sync or async is not specified, the NFS server prints a warning when it is started.
No_root_squash: If the NFS client uses root to connect to the server, the root permission is also used for the Directory shared by the server. Insecure!
Root_squash: maps the UID/GID (0/0) of the root identity of the client to the nobody user of the server, that is, the server uses the nobody user to operate the shared directory;
All_squash: No matter which user the NFS client uses to connect to the server, the directory shared by the server is anonymous;
Anonuid: uid value of an anonymous user, usually nobody or nfsnobody, which can be set here;
Anongid: the GID value of an anonymous user.

Install and configure the NFS server in centos 6.5

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.