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 install NFS service in Centos7 system

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

In this issue, the editor will bring you about how to install NFS services in the Centos7 system. The article is rich in content and analyzed and described from a professional point of view. I hope you can get something after reading this article.

1. Install the software packages required for the NFS server:

Yum install-y nfs-utils

Edit the exports file and add the slave

Vim / etc/exports/home/nfs/ 192.168.248.0 take 24 (rw,sync,fsid=0)

Hosts with the same network number as 192.168.248.0 home/nfs/ 24 can mount the / home/nfs/ directory on the NFS server to their own file system.

Rw means to read and write; sync means to write synchronously; fsid=0 means to package / data to find a directory as a root directory

3. Start nfs service

Boot rpcbind and nfs first: (rpcbind service must be started first)

Systemctl enable rpcbind.servicesystemctl enable nfs-server.service

Then start the rpcbind and nfs services, respectively:

Systemctl start rpcbind.servicesystemctl start nfs-server.service

Confirm that the NFS server starts successfully:

Rpcinfo-p

Check whether the NFS server mounts the directory / home/nfs/: that we want to share

Exportfs-r

# make the configuration effective

Exportfs

# you can see that it has been ok

/ home/nfs 192.168.248.0/24

Install the NFS client on the slave computer

First install nfs, as above, and then start the rpcbind service

Boot the rpcbind first:

Systemctl enable rpcbind.service

Then start the rpcbind service:

Systemctl start rpcbind.service

Note: clients do not need to start the nfs service

Check if there is a directory share on the NFS server side: the IP of the showmount-e nfs server

Showmount-e 192.168.248.208Export list for 192.168.248.208:/home/nfs 192.168.248.0 Universe 24

Use mount to mount the server-side directory / home/nfs to the client-side directory on the slave machine:

Cd / home & & mkdir / nfsmount-t nfs 192.168.248.208:/home/nfs / home/nfs

Df-h to see if the mount is successful.

The above is the editor for you to share how to install NFS services in the Centos7 system, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

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

Servers

Wechat

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

12
Report