nfs客户端通过mount实现连接服务器
下载安装nfs-utils
1 | yum install nfs-utils |
确认
1 | [root@client ~]# showmount -e 192.168.64.48 |
挂载锚点
1 | mount -t nfs 192.168.64.48:/tmp/nfs /mnt |
Automatically mount by using autofs
One drawback of using /etc/fstab is that, regardless of how infrequently a user accesses the NFS mounted file system, the system must dedicate resources to keep the mounted file system in place. This is not a problem with one or two mounts, but when the system is maintaining mounts to many systems at one time, overall system performance can be affected.
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/nfs-autofs
Step1. Install autofs
1 | dnf -y install autofs |
Step2. Edit auto.master for direct mapping
1 | vim /etc/auto.master |
Step3. Edit auto.misc
1 | vim /etc/auto.misc |
Step4. Restart autofs to apply the changes
systemctl restart autofs