A directory on the data server (A) is shared by other servers (B).
1. Data server A
(1)下载
sudo apt-get install nfs-kernel-server
sudo apt-get install nfs-common
(2) Configure
sudo vim /etc/exports
* Indicates that any network segment IP system is allowed to access the NFS directory, and the IP can also be specified
(3) Start the nfs service
sudo /etc/init.d/nfs-kernel-server start
(4) Check nfs status
service nfs-server status
2. Client B
Same as 1, the configuration is slightly different: /local directory*(ro,sync,no_subtree_check,no_root_squash), which means that the local directory can be mounted by any IP.
After checking that the nfs-server is started, mount the shared directory:
sudo mount [A_IP]:[shared directory] [local directory]