-
查看是否安装
rpm -qa |grep nfs
rpm -qa |grep rpcbind
-
使用yum -y install nfs-utils rpcbind命令进行安装
-
关闭防火墙,selinux
[root@master ~]# systemctl stop firewalld.service
[root@master ~]# setenforce 0
-
禁止防火墙开机自启动
systemctl disable firewalld.service
-
启动服务,一定要先启动rpc再启动nfs
nfs需要向rpc注册,rpc一旦重启,所以注册的文件都丢失,其他向注册的服务都需要重启
启动rpc服务:
systemctl start rpcbind.service
启动nfs服务:
systemctl start nfs.service
-
查看服务启动的状态
systemctl status rpcbind.service
systemctl status nfs.service
-
vi /etc/exports
/mnt *(rw,sync,no_root_squash)
-
重启rpcbind再重启nfs:
重启rpc服务:
systemctl restart rpcbind.service
重启nfs服务:
systemctl restart nfs.service
-
在客户端进行挂载
mount -t nfs 192.168.137.139:/mnt /tmp
挂载nfs
最新推荐文章于 2024-01-20 01:52:19 发布