查看是否已安裝:
rpm -qa | grep nfs-*dpkg -l | grep nfs-*sudo yum install -y nfs-utils portmapsudo yum install -y nfs-utils rpcbindsudo apt-get install -y nfs-common nfs-kernel-server配置文件介紹(記得先備份):sudo vim /etc/exports
chmod 777 folderName)。/opt/mytest 192.168.0.0/55(rw,sync,all_squash,anonuid=501,anongid=501,no_subtree_check)* 號表示/etc/init.d/rpcbind restart/etc/init.d/nfs-kernel-server restartshowmount -e 192.168.1.25(這個 IP 是 NFS 的服務器端 IP)
mount -t nfs 192.168.1.25:/opt/mytest/ /mytest/
df -h 可以看到多了一個 mytest 分區(qū)。然后我們可以再創(chuàng)建一個軟鏈接,把軟鏈接放在 war 包的目錄下,這樣上傳的圖片都會跑到另外一臺服務器上了。軟鏈接相關內容請自行搜索。