A服務器的文件夾,共享,B服務器的文件夾。參考。bash
在服務器A的data_sharing
中,建立文件夾:服務器
cd /data_sharing/
sudo mkdir -p data41_data1/
複製代碼
掛載服務器B的遠程文件夾:ui
sudo mount xxx.xx.xx.41:/data1 data41_data1/
複製代碼
這樣,在服務器A中,就能夠訪問服務器B的數據。spa
若是出現錯誤,可能須要重啓nfs服務。rest
sudo systemctl restart nfs-kernel-server
複製代碼
若是出現如下問題,則NFS(Network File System)服務未安裝。code
mount: wrong fs type, bad option, bad superblock on xxx.xx.xx.41:/data1,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)
In some cases useful info is found in syslog - try
dmesg | tail or so.
複製代碼
執行如下命令,安裝和啓動NFS便可。server
sudo apt install nfs-kernel-server
sudo apt install nfs-common
sudo systemctl restart nfs-kernel-server
複製代碼
OK, that's all!blog