Implementation of mapping remote disk directory with NSF in Linux

Time:2020-11-28

Suppose the source directory is on the 192.168.1.1 machine and the directory is / data

If the client cluster is 192.168.1.2, you need to transfer the / data directory on the 192.168.1.1 machine to the local / data directory

1. Install NSF and portmap on two machines

yum  install  nfs-utils  portmap

After installation.

2. Modify the / etc / exports file on the 192.168.1.1 machine and add the following

/data/ 192.168.1.2(rw,sync,no_ root_ The host 192.168.1.2 has RW permission on the directory. Other parameters can be viewed in the NSF document, which is not explained here

The NSF and portmap services are then enabled

service rpcbind start
service nfs start

3. Start the NSF and portmap services on the 192.168.1.2 machine, and then mount the remote directory

service rpcbind start
service nfs start

mount -t nfs 192.168.1.1:/data/  /data/

Hang the / data directory above the machine 192.168.1.1 under the / data directory of the local machine

Now you can read and change the / data directory on the 192.168.1.2 machine.

The implementation of using NSF to map remote disk directory in Linux is the whole content shared by Xiaobian. I hope to give you a reference, and I hope you can support developeppaer more.