Redhat7配置NFS


安装:

# yuminstall nfs-utils  (或rpm -i

 

共享/home

# vi/etc/exports

 

/home     10.0.0.3(rw,async,root_squash)

 

:wq

 

全部参数为:ro,rw,async,sync,root_squash,no_root_squash,all_squash

 

可为单个ip,可为网段(如:10.0.0.0/24),可为域名(如:*.ming.com

 

启动nfs

#systemctl start nfs-server

 

exportfs–arv =  systemctl restart nfs-server

 

开机启动nfs

#systemctl enable nfs-server

 

开启防火墙:

#firewall-cmd –permanent –add-service=nfs

#firewall-cmd –permanent –add-service=mountd

#firewall-cmd –permanent –add-service=rpc-bind

 

客户端:

 

查看服务器端共享:

#showmount –e 10.0.0.2

 

挂载:

# mount –tnfs 10.0.0.2:/home  /aa

 

写到/etc/fstab

# vi/etc/fstab

10.0.0.2:/home   /aa nfs    defaults   0 0

:wq