nfs服务器
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]#
原文地址:https://blog.csdn.net/wxhxmj/article/details/143969536
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!