服务器端
useradd -d /home/app/legacys4c_prod -c "nfs" -s /bin/bash -u 1010 legacys4c_prod
sudo -u legacys4c_prod mkdir ""/home/app/legacys4c_prod/recv"" sudo -u legacys4c_prod mkdir ""/home/app/legacys4c_prod/send"" sudo -u legacys4c_prod mkdir ""/home/app/legacys4c_prod/ifdata""
yum install nfs-utils
rpm -qa |grep nfs-utils
systemctl list-unit-files | grep nfs-utils
cp -p /etc/exports /etc/exports.20220620 vi /etc/exports
cat /etc/exports
exportfs -rv
客户端
yum install nfs-utils
rpm -qa | grep nfs-utils
systemctl list-unit-files | grep nfs-utils
yum install autofs
rpm -qa | grep autofs
showmount -e pvcy031
mkdir /mnt/nfs
cp /etc/auto.master /etc/auto.master.20220620 vi /etc/auto.master
diff /etc/auto.master /etc/auto.master.20220620
touch /etc/auto.pvcy031 cp /etc/auto.pvcy031 /etc/auto.pvcy031.20220620 vi /etc/auto.pvcy031
recv -fstype=nfs,soft,intr,rsize=8192,wsize=8192,nosuid pvcy031:/home/app/legacys4c_prod/recv send -fstype=nfs,soft,intr,rsize=8192,wsize=8192,nosuid pvcy031:/home/app/legacys4c_prod/send ifdata -fstype=nfs,soft,intr,rsize=8192,wsize=8192,nosuid pvcy031:/home/app/legacys4c_prod/ifdata
diff /etc/auto.pvcy031 /etc/auto.pvcy031.20220620
systemctl start autofs 或者 systemctl restart autofs
进入/mnt/nfs目录使用ls命令查看是空的没有文件,但是可以cd进入命令recv、send、ifdata
su - legacys4c_prod
记得用指定的用户
ln -s /mnt/nfs/recv /home/app/legacys4c_prod/recv ln -s /mnt/nfs/send /home/app/legacys4c_prod/send ln -s /mnt/nfs/ifdata /home/app/legacys4c_prod/ifdata
cd /home/app/legacys4c_prod/ ll recv ifdata send标签:NFS,app,etc,自动,home,挂载,legacys4c,prod,nfs From: https://www.cnblogs.com/gzb891/p/16892167.html