RedHat 7 Configuring NFS Services

Source: Internet
Author: User

RedHat 7 NFS Service Although the configuration file and RedHat 6, but the service name has undergone a major change, this article describes the configuration process.

First create two directories under/data as a shared directory, a name called/data/nfsshare, will be configured to read and write, a name called/data/nfspublic, will be configured as read-only.

650) this.width=650; "title=" 01.png "style=" Float:none; "alt=" wkiol1dom7xqx0zaaaahdyviyma295.png "src=" http:/ S1.51cto.com/wyfs02/m00/83/00/wkiol1dom7xqx0zaaaahdyviyma295.png "/>


Grant 777 permissions to the Nfsshare directory

650) this.width=650; "title=" 08.png "style=" Float:none; "alt=" wkiol1dom7qbxfilaaadiaxqktg168.png "src=" http:/ S1.51cto.com/wyfs02/m02/83/00/wkiol1dom7qbxfilaaadiaxqktg168.png "/>


To edit an NFS profile:vi/etc/exports, fill in the following (where * represents all clients can access, RW is read-write, RO is read-only)

650) this.width=650; "title=" 02.png "style=" Float:none; "alt=" wkiom1dom7wyrb9-aaagbs0yofm658.png "src=" http:/ S1.51cto.com/wyfs02/m00/83/01/wkiom1dom7wyrb9-aaagbs0yofm658.png "/>

"when no parameters are specified, sync,ro,root_squash,no_delay ip When the address is empty, it represents a shared service to any client. When you share the same directory with multiple clients, but you do not have the same permissions for each client, you can:

[Shared directory ] [ hostname 1 or IP1 ( parameter 1, parameter 2) ] [ host name 2 or IP2 ( parameter 3, parameter 4)]

[Email protected]~]# vi/etc/exports

/tmp * (Rw,no_root_squash,sync)

/home/public 192.168.0.0/24 (Rw,sync) * (Ro,sync)

/home/test 192.168.0.100 (Rw,sync)

the content is collected from the Internet and has not been tested "


RedHat 7 Service for NFS: mainly involving Rpcbind, Nfs-server, nfs-idmap three services

View Rpcbind Service service started:systemctl status Rpcbind, start it if not started

650) this.width=650; "title=" 03.png "style=" Float:none; "alt=" wkiol1dom7jrnegmaaatye-ecqg730.png "src=" http:/ S3.51cto.com/wyfs02/m01/83/00/wkiol1dom7jrnegmaaatye-ecqg730.png "/>

Set up Nfs-server service boot automatically:systemctl enable Nfs-server

Start Nfs-server service:systemctl start Nfs-server

View Rpcbind Service service started:systemctl status Nfs-idmap, start it if not started

650) this.width=650; "title=" 04.png "style=" Float:none; "alt=" wkiom1dom7iigpelaabkt7jdhtg798.png "src=" http:/ S3.51cto.com/wyfs02/m01/83/01/wkiom1dom7iigpelaabkt7jdhtg798.png "/>


View Shared Directories:showmount-e 192.168.10.14

650) this.width=650; "title=" 05.png "style=" Float:none; "alt=" wkiol1dom7jakzrkaaap-aajdhk268.png "src=" http:/ S3.51cto.com/wyfs02/m02/83/00/wkiol1dom7jakzrkaaap-aajdhk268.png "/>


Reload configuration file:exportfs

650) this.width=650; "title=" 06.png "style=" Float:none; "alt=" wkiom1dom7jyv1ipaaamio1uros705.png "src=" http:/ S3.51cto.com/wyfs02/m02/83/01/wkiom1dom7jyv1ipaaamio1uros705.png "/>


Linux Client Test mount shared directory:

Create a client mount point directory:Mkdir/tmp/nfs

Mount the Nfsshare on the server to/tmp/nfs:Mount 192.168.10.14:/data/nfsshare/tmp/nfs

To view mount results:df-h

650) this.width=650; "title=" 07.png "style=" Float:none; "alt=" wkiol1dom7mtknzpaaayfwkyvp4174.png "src=" http:/ S1.51cto.com/wyfs02/m01/83/00/wkiol1dom7mtknzpaaayfwkyvp4174.png "/>

Test write:touch/tmp/nfs/nfstest02.txt, write succeeded, the file can be seen in the/data/nfsshare directory

650) this.width=650; "title=" 09.png "style=" Float:none; "alt=" wkiom1dom7rcn7maaaapicuxccw445.png "src=" http:/ S1.51cto.com/wyfs02/m00/83/01/wkiom1dom7rcn7maaaapicuxccw445.png "/>


Create a second client mount point directory:mkdir/tmp/nfspublic

Mount the nfspublic on the server to/tmp/nfspublic:

Mount 192.168.10.14:/data/nfspublic/tmp/nfsPublic

650) this.width=650; "title=" 10.png "style=" Float:none; "alt=" wkiol1dom7vaiuoaaaaiesmrrjg254.png "src=" http:/ S1.51cto.com/wyfs02/m01/83/00/wkiol1dom7vaiuoaaaaiesmrrjg254.png "/>

Viewing shared directories that have been mounted

650) this.width=650; "title=" 11.png "style=" Float:none; "alt=" wkiom1dom7uygsx0aaas9i4xo-8971.png "src=" http:/ S3.51cto.com/wyfs02/m01/83/01/wkiom1dom7uygsx0aaas9i4xo-8971.png "/>

The server's Nfspublic directory is also granted 777 permissions to test if the read-only setting of the NFS configuration file is valid, and you can see that the file was written with a failure, prompting Read-only file system

650) this.width=650; "title=" 12.png "style=" Float:none; "alt=" wkiom1dom7uqcwkcaaatjuar45m213.png "src=" http:/ S3.51cto.com/wyfs02/m02/83/01/wkiom1dom7uqcwkcaaatjuar45m213.png "/>


If the client is asked to mount the NFS shared directory automatically, it is necessary to write mount information on the client's/etc/fstab file, such as

650) this.width=650; "title=" 13.png "style=" Float:none; "alt=" wkiol1dom7uw7icyaaa0-bqr4qc092.png "src=" http:/ S3.51cto.com/wyfs02/m02/83/00/wkiol1dom7uw7icyaaa0-bqr4qc092.png "/>


This article is from the "Jiangjianrong Technology blog" blog, make sure to keep this source http://jiangjianlong.blog.51cto.com/3735273/1791261

RedHat 7 Configuring NFS Services

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.