使用NAS存储 挂载业务服务器当图片服务器使用 (NFS=NAS)
#步骤
服务器地址:http://120.55.164.127:8080/admin/index
1.找到图片目录
http://120.55.164.127:8080/attachment/20240402/24c545f31b5a41b4b1324aaf14980245.png
[root@tomcat 20240402]# pwd
/data/tomcat/webapps/ROOT/attachment/20240402
/data/tomcat/webapps/ROOT/attachment/ #tips:最终需要挂载的目录
备份图片目录
mv 20240402/ /home
2.挂载
sudo mount -t nfs -o vers=3,nolock,proto=tcp,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport 363e1495d9-yqg71.cn-shanghai.nas.aliyuncs.com:/ /data/tomcat/webapps/ROOT/attachment/
cp -r /home/20240402/ /data/tomcat/webapps/ROOT/attachment/
3.永久挂载
vi /etc/rc.local
sudo mount -t nfs -o vers=3,nolock,proto=tcp,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport 363e1495d9-yqg71.cn-shanghai.nas.aliyuncs.com:/ /data/tomcat/webapps/ROOT/attachment/
4.测试目录
http://120.55.164.127:8080/c/%E9%98%BF%E9%87%8C%E4%BA%91%E5%AD%A6%E4%B9%A0%E5%90%A7