linux查看nfs服务哪些,NFS · Linux服务器 · 看云

## Server:192.168.1.211

```

yum -y install nfs-utils

vim /etc/exports

/nfsfile 192.168.1.*(rw,sync,root_squash)

mkdir /nfsfile

chmod -Rf 777 /nfsfile

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

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

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

firewall-cmd --reload

systemctl restart nfs-server

systemctl enable nfs-server

systemctl restart rpcbind

systemctl enable rpcbind

exportfs -arv //开启对外发布

exportfs -auv //关闭对外发布,关闭后客户端使用 showmount -e 无法查看

```

## Desktop:192.168.1.210

```

yum -y install nfs-utils

showmount -e 192.168.1.211

mkdir /nfsfile

mount -t nfs 192.168.1.211:/nfsfile /nfsfile //临时挂载

vim /etc/fstab

192.168.1.211:/nfsfile /nfsfile nfs defaults 0 0//持久挂载需要写入 fstab 文件

//defaults 可以修改为 rw,tcp,intr

```

## /etc/exports

| 参数 | 作用 |

| --- | --- |

| ro | 制度 |

| rw | 读写 |

| root_squash | 当NFS客户端以root管理员访问时,映射为NFS服务器的匿名用户 |

| no_root_squash | 当NFS客户端以root管理员访问时,映射为NFS服务器的root管理员 |

| all_squash | 无论NFS客户端使用什么账户访问,均映射为NFS服务器的匿名用户 |

| sync | 同时将数据同时写入内存与硬盘中,保证不丢失数据 |

| async | 优先将数据保存到内存,然后再写入硬盘;这样效率高,但可能会丢失数据 |

## NFS 仅能实现 linux 之间的文件共享

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值