Linux learning-server B mounts the folder of server A, and linux mounts
Environment:CentOS 1, 7.0
1. In centos, server B mounts the folder of server.
Server A: 101,. 10.0.1
Server B: 101.10.12.1
Prerequisites: ensure that the server A and server B have/ifs/data/folders.
Objective: To mount the/ifs/data/folder of server A to your/ifs/data/folder on server B.
Step 1. Edit the/etc/exports file of server.
# vi/etc/exports
Add the following content to allow it to add trust to server B
/ifs/data 101.10.12.1 (rw,no_root_squash,no_all_squash,sync)
Enter the following command to make the configuration take effect
exportfs -r
Step2. mount the shared folder on server B
Mount the folder of server A on server B and enter the following command:
Mount the file by using the mount command. It takes effect only once and is invalid after restart. The command is as follows:
mount -t nfs 101.10.0.1:/ifs/data /ifs/data
If you want to take effect after restart, You need to modify the/etc/fstab file of server B.
vi /etc/fstab
Add the following content
101.10.0.1:/ifs/data /ifs/data nfs defaults 0 0
After saving and exiting wq, you can run the mount-a command to check whether the mount is successful.
Refer to the blog post: torque cluster configuration under CentOS (2) Configure NFS in the cluster for file sharing
The Linux Learning Series in this topic will be updated continuously. Welcome to this blog: Dream_Angel_z