NFS
Net File System
nfs基本信息
nfs-utils ##安装包
nfs-server ##服务脚本
/etc/exports ##共享配置文件
nfs的启用
systemctl start nfs-server
firewall-cmd --permanent --add-service=rpc-bind firewall-cmd --permanent --add-service=mountd firewall-cmd --permanent --add-service=nfs firewall-cmd --reload
测试:
[root@dns_node1 ~]# showmount -e 192.168.0.30 Export list for 192.168.0.30:
nfs配置
vim /etc/exports ##此文件更改后生效exportfs -rv
共享目录 共享给谁(共享参数)
/westosdir * (ro)
测试:
mount 192.168.0.30:/westosdir /mnt/
nfs配置参数
anonuid=1000,anongid=1000 ##指定用户身份
sync ##更改生成后同步数据到服务器
async ##时时同步数据到服务器
rw ##读写
ro ##只读
no_root_squash ##root用户挂载不转换身份
nfs+autofs
参看autofs章节内容
vim /etc/auto.nfs
nfs 192.168.0.30:/westosdir