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 configure NFS service sharing in CentOS7

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

Share

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

This article introduces the knowledge of "how to configure NFS service sharing in CentOS7". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Detailed configuration 1. Prophase configuration

Turn off the firewall and selinux of the server and the client, where the server refers to the storage server that needs to be shared, and the client refers to the other 8 computing nodes. All of the following commands are in the CentOS7 environment

1.1 turn off the firewall

Systemctl stop firewalld

1.2 set selinux to license mode (or turn off)

Etenforce 0

(if you want to disable it, you need to change the configuration file, set SELINUX to disabled, and the restart takes effect.)

two。 Server configuration

2.1 install the required software packages (using yum)

Yum install-y rpc-bind nfs-utils

2.2 create the folder you want to share, for example, / datas

Mkdir / datas

2.3 set the permissions of the shared directory to be readable and writable for all users

Chmod-R 777 / datas

2.4 modify the main configuration file / etc/exports of the NFS service

Vim / etc/exports

# add the following rules

/ datas * (rw,sync)

The rule states: / datas represents shared files, * represents that all hosts can access, rw refers to read and write permissions, and sync indicates the use of synchronization. Other more precise options are as follows:

2.5 enable NFS service

Systemctl start nfs

Now that the nfs on the server is configured, recall that we have mainly done:

Turn off the firewall and selinux to share the directory / datas we created through the nfs main configuration file / etc/exports to open the nfs service

Ps: if you want to share one of the server's hard drives, simply mount the / datas directory to that hard disk using the mount command. The command to view the hard disk and mount is:

Df-h

For example, mount a hard disk device / dev/sdd to / datas

Mount / dev/sdd / datas

Next, configure the client

3. Client configuration

3.1 turn off the firewall and selinux

Same as above

3.2 install NFS

Same as above

Mount the shared directory on the server to the local / data-nfs directory. My ip here is the ip of the IB card. If there is no IB driver, you can use the intranet ip,/data-nfs directly. This is my custom directory.

Mount-t nfs 12.12.12.29:/datas / data-nfs

At this point, when the client is configured, accessing the / data-nfs directory is equivalent to accessing the server's / datas directory

Ps: problems may occur after the above configuration is rebooted. It is recommended to set the configuration to boot and execute.

This is the end of "how to configure NFS service sharing in CentOS7". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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