1、nfs配置
安装
- [root@localhost ~]# yum install rpcbind
- [root@localhost ~]# yum install nfs-utils
服务端(192.168.217.129)
- [root@localhost ~]# mkdir /data
- [root@localhost ~]# vi /etc/exports
- [root@localhost ~]# cat /etc/exports
/data 192.168.217.130(rw)
- [root@localhost ~]# chmod o+w /data/
- [root@localhost ~]# systemctl disable firewalld --now
- [root@localhost ~]# getenforce
Enforcing
- [root@localhost ~]# setenforce 0
- [root@localhost ~]# systemctl restart nfs-server
- [root@localhost ~]# showmount -e 192.168.217.129
Export list for 192.168.217.129:
/data 192.168.217.130
客户端(192.168.217.130)
- [root@localhost ~]# showmount -e 192.168.217.129
Export list for 192.168.217.129:
/data 192.168.217.130
- [root@localhost ~]# mkdir -p /nfsclient/client-data/
- [root@localhost ~]# mount 192.168.217.129:/data /nfsclient/client-data/
- [root@localhost ~]# df -h
2、配置autofs自动挂载
客户端(192.168.217.130)
- [root@localhost ~]# yum install autofs -y
- [root@localhost ~]# vim /etc/auto.master
- [root@localhost ~]# vim /etc/auto.wqq
- [root@localhost ~]# grep wqq /etc/auto.master
/nfsclient /etc/auto.wqq
- [root@localhost ~]# cat /etc/auto.wqq
wqq 192.168.217.129:/data
- [root@localhost ~]# systemctl restart autofs
- [root@localhost ~]# cd /nfsclient/wqq
- [root@localhost wqq]#
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |