Centos7.5 two servers NFS shared folder construction

One. Setting up the environment (offline deployment)

Server A: 10.10.10.130 master node
Server B: 10.10.10.129 client mount node

two. Build steps

1. NFS service establishment

Download address: https://download.csdn.net/download/suntongxue100/12739587
(1) Unpack:

tar zxvf filename.tar

(2) Enter the decompressed temp folder and install the offline package:

rpm -ivh *.rpm --force –nodeps

(3) Start nfs service and set boot up:

systemctl start rpcbind
systemctl start nfs
systemctl enable rpcbind.service
systemctl enable nfs-server.service

(4) Turn off the firewall
Stop the firewall: systemctl stop firewalld
turn off the firewall:systemctl disable firewalld

Both the master node 130 and the client node 129 must perform the above steps 1-4.

2. The master node is set to enable sharing

(1) Create the folder to be shared.
Create the nfsdata folder in the root directory and grant 777 permissions
(2) Edit the exports file

vi /etc/exports

increase:

/nfsdata  10.10.10.129(rw,sync,no_root_squash)

or:/nfsdata *(rw,sync,no_root_squash)

(3) Restart the service:

systemctl restart nfs
systemctl restart rpcbind

3. Client node mount sharing

(1) Create a folder with the same name to mount
the root folder creation nfsdata, giving 777
Mount: sudo mount -t nfs 10.10.10.130:/nfsdata /nfsdata
(if required unmounted: sudo umount /nfsdata)
(2) set the boot automatically mount
vi / etc / fstab
increase:

10.10.10.130:/nfsdata /nfsdata  nfs  rw,noac,suid,dev,exec,auto,nouser,async 0  0

At this point, /nfsdata has been a shared folder, and you can create a new file on the client to test read and write.

Guess you like

Origin blog.csdn.net/suntongxue100/article/details/108169233