关于ubuntu:Linux系统配置NFS文件共享服务

3次阅读

共计 929 个字符,预计需要花费 3 分钟才能阅读完成。

相似 winodws 的网络共享性能,Linux 零碎也提供了多种网络文件共享形式,常见的有 NFS,Samba,FTP,本文介绍 NFS 的形式网络文件系统装置与配置

NFS 简介

nfs 在在消息传递过程中依赖 RPC 协定,应用 NFS 时用户端只须要应用 mount 命令将近程主机的目录挂载到本地即可。
例如要把 10.10.0.12 的 /home/test 挂载到本地 10.10.0.11 的 /home/test 目录下

[root@localhost ~]# mount 10.10.0.12:/home/test /home/test

配置 NFS 服务器

NFS 须要装置 nfs-utils.rpm rpcbind.rpm

版本号因零碎版本有所差异

[root@localhost ~]# yum install -y nfs-utils rpcbind
……

exports 参数阐明

-a 全副挂载 /etc/exports 文件内的设置,-r 从新挂载 /etc/exports 文件内的设置,- u 卸载某一目录

shownmount 参数阐明

-a 列出 nfs 共享的残缺目录信息,-d 列出客户端近程装置的目录,-e 显示导出目录的列表

nfs 参数阐明

ro 只读权限,rw 读写权限,all_squash 匿名用户或组,no_all_squash 非匿名用户或组,root_squash 将 root 用户和组映射为匿名用户和组,no_root_squash 与 root_squash 相同,sync 将数据同步写入缓冲区中,async 将数据先保留在内存缓冲区,再写入磁盘

设置 expoprts 文件

[root@localhost ~]# cat /etc/exports
/home/test .(rw)

启动服务

[root@localhost ~]# systemctl start rpcbind
[root@localhost ~]# systemctl start nfs-server

配置 NFS 客户端

[root@localhost ~]# mount -t nfs -o rw 10.10.0.12:/home/test /home/test

如此,就能够应用!

本文原创地址:https://www.linuxprobe.com/redhat-nfs-server.html 编辑:王华超,审核员:逄增宝

正文完
 0