Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build NFS service under Centos7

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to build NFS services under Centos7. I hope you will get something after reading this article. Let's discuss it together.

First, the server

1. Download NFS related services with YUM source

two。 Create a shared directory and write it to the shared directory in NFS-related configuration files

3. Use exportfs to make the settings take effect immediately

4. Restart NFS related services

5. Test the status of the NFS output directory using the showmount command

II. Client

1. Download NFS related services

two。 Check what shared directories the server IP has to allow clients to connect

3. Establish the client directory and mount the server output directory under the client directory

III. Testing service

1. Restart the NFS service on the server side and give the server the necessary permissions to output the directory

two。 Enter the output directory on the server side and create a file

3. Go back to the client to restart the NFS service and enter the client's mount directory to view the files written by the server

At this point, the NFS service has been built and added:

Rw # client can read and write to shared directory ro # client only read but not write to shared directory sync # synchronous mode, that is, write memory data to hard disk in real time, but this will reduce disk efficiency async # asynchronous mode, that is, memory data will be written to hard disk at regular intervals Disk efficiency can be guaranteed, but data in memory will be lost in the event of abnormal downtime / power outage. No_root_squash # after the client mounts the NFS shared directory, the root users on the client are not restricted by these mount options, and the permissions are very high. Root_squash # contrary to no_root_squash, root users on the client are limited by these mount options All users on the all_squash # client are limited to an ordinary user when using the NFS shared directory. Several squash on anonuid # are used to limit the client user to the ordinary user, while anouid is used to define the uid of this ordinary user. This uid corresponds to the / etc/passwd file on the server. Such as: anouid=1000 # for example, if my client uses xiaoming to create a file, then when the server synchronizes the file, the owner of the file will become the user anongid # corresponding to the server's uid (1000). The gid used to limit this ordinary user has read this article. I believe you have some understanding of "how to build a NFS service under Centos7". If you want to know more related knowledge, welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report