The first step, create two virtual machines
One serves as a client and one serves as a server.
Install nfs-utils rpcbind separately and start the service
yum install nfs-utils rpcbind -y
systemctl start nfs
systemctl start rpcbind
Step 2: Create a shared path on the server
vi /etc/exports, add a line to the file
/nfsfile *(rw,no_root_squash,sync)
Create a shared path and export, and turn off the firewall
mkdir /nfsfile
exportfs -rv
systemctl stop firewalld
Check it out
The third step, mount on the client
Log in to the client and check whether it can be mounted first.
Create a directory locally for mounting, and start mounting.
mkdir /mnt/kyc
mount -t nfs 192.168.149.217:/nfsfile /mnt/kyc
Mounted successfully.
The fourth step, mount on the client
Create a txt file on the client, you can find that the server has this file.