CentOS 7 Installation Configuration NFS

Source: Internet
Author: User
Tags root access

CentOS 7 Installation Configuration NFS

Environment

NPS 192.168.1.97

Client 192.168.1.98

One, yum installation

Yum-y Install Nfs-utils Rpcbind

Configuration file for NFS/etc/expots

Default is empty

Vi/etc/exports

/OPT/TEST/192.168.1.0/24 (rw,no_root_squash,no_all_squash,sync,anonuid=501,anongid=501)

Second, make the configuration effective

Exportfs-r

Note: Configuration file Description:

/opt/test for shared directory

192.168.1.0/24 can be a network segment, an IP, or a domain name, and the domain name supports wildcard characters such as: *.qq.com

Rw:read-write, can read and write;

Ro:read-only, read-only;

Sync: The file is written to both the hard disk and memory;

Async: Files are staged in memory instead of directly to memory;

No_root_squash:nfs the client connects to the server, if root is used, it also has root access to the directory shared by the server. Obviously it's not safe to turn it on.

Root_squash:nfs the client connects to the server, if root is used, then the directory shared by the server, with anonymous user rights, usually he will use nobody or nfsnobody identity;

All_squash: Regardless of which user is used by the NFS client to connect to the server, the directory shared by the server has anonymous user rights;

Anonuid: The UID value of the anonymous user, which can be set at its discretion.

Anongid: The GID value of the anonymous user.

Third, start NFS

Service Rpcbind Start

Service NFS Start

Chkconfig Rpcbind on

Chkconfig NFS On

Iv. Client Mount:

SHOWMOUNT-E 192.168.1.97 #查看可挂载

Export list for 192.168.1.97:

/opt/test 192.168.1.0/24

Client Mount

Mount-t NFS 192.168.1.97:/opt/test/mnt

Silent both for success

The client encountered a problem at the time of mounting, perhaps the network is not very stable, NFS is the default UDP protocol, replaced by the TCP protocol:

Mount-t NFS 192.168.1.97:/opt/test/mnt-o Proto=tcp-o nolock

CentOS 7 Installation Configuration NFS

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.