Environment: CentOS 7.0
Server B Mounts Server A's disk in 1.centos
Server a:101,.10.0.1
Server b:101.10.12.1
Premise: Ensure that Server A and B have/ifs/data/folders
Purpose: To mount Server A's/ifs/data/folder to its/ifs/data/folder on Server B.
Step1. Edit the/etc/exports file for server a
# vi/etc/exports
Add the following to add trust functionality 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 effective
exportfs-r
STEP2. Mounting a shared disk on Server B
Mount Server A's disk on Server B and enter the command:
Use mount mounts, can only be effective once, restart after the invalid, the command is as follows
101.10.0.1:/ifs/data /ifs/data
If you want to restart and also take effect, you need to modify Server B's/etc/fstab file
vi /etc/fstab
Add the following content
101.10.0.1:/ifs/data /ifs/data nfs defaults 00
Use: Wq after you save the exit, you can use the MOUNT-A command to see if it can be mounted successfully.
Reference post: CentOS torque cluster Configuration (ii) configuring NFS for file sharing in a cluster
This section of the Linux Learning Series will continue to update, welcome to follow this blog: dream_angel_z
Linux Learning-Server B mounts disk for Server A