NFS服务器的配置_第1页
NFS服务器的配置_第2页
NFS服务器的配置_第3页
NFS服务器的配置_第4页
NFS服务器的配置_第5页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、 NFS服务器的配置1.1NFS概述 NFS是一种分布式文件系统允许网络中的安装不同的操作系统的计算机之间共享文件。 我的安装环境:redhat5.9NFS服务器的主要软件包:nfs-utils-1.0.9-66.el5portmap-4.0-65.2.2.1系统服务脚本:NFS portmap主配置文件:/etc/exports、/etc/exports配置解析:-共享目录客户机地址(参数,参数. .)参数的介绍:Rw:可读可写Ro:只读Sync:同步写入 :写入内存的同时写入硬盘Async:异步写入: 先写入内存在写入硬盘N0_root_squash:保留来之客户端的root权限All_s

2、quash:客户端的权限都降级为nfsnobody1.2NFS的安装 root dhcpser# rpm -q nfs-utils portmap /查看软件包是否安装nfs-utils-1.0.9-66.el5portmap-4.0-65.2.2.1如果没有安装可以利用yum库进行安装root dhcper#yum-y install nfs-utilsroot dhcper#yum-y install portmapNFS服务器端配置:rootdhcpser # cat /etc/exports /编辑共享配置文件/root 192.168.10.20(rw,sync,no_root_sq

3、uash) 共享/root给192.168.10.20,可写、同步,允许客户机以root权限访问rootdhcpser # service portmap restart /运行portmap脚本 rootdhcpser # service nfs restart /运行nfs脚本rootdhcpser # chkconfig portmap on / 配置开机启动 rootdhcpser # chkconfig nfs on /配置开机启动 客户端配置:rootlocalhost # service portmap restart /运行portmap脚本 rootlocalhost # s

4、howmount -e 192.168.10.253 /查看nfs共享列表Export list for 192.168.10.253:/root 192.168.10.20 /服务器端的共享rootlocalhost # mkdir -p /data/root/ /创建挂载目录rootlocalhost # mount 192.168.10.253:/root/ /data/root/ /挂载rootlocalhost # df -hT | grep nfs nfs 19G 2.7G 16G 15% /data/rootrootlocalhost # cd /data/root/rootlo

5、calhost root# touch file1.txtrootlocalhost root# ls -l file1.txt -rw-r-r- 1 root root 0 06-12 17:18 file1.txt例如:NFS服务器配置:rootdhcpser # cat /etc/exports /编辑配置文件/root 192.168.10.20(rw,sync,no_root_squash)/usr/src 192.168.10.0/24(rw,async) /共享给10.0网段,可写,异步rootdhcpser # exportfs -rv /重新发布信息rootdhcpser #

6、 setfacl -m u:nfsnobody:rwx /usr/src/ /添加读写权限客户端操作:rootlocalhost # mkdir /data/src/ 创建挂载点rootlocalhost # showmount -e 192.168.10.253 /查看共享Export list for 192.168.10.253:/root 192.168.10.20/usr/src 192.168.10.0/24rootlocalhost # mount 192.168.10.253:/usr/src/ /data/src/rootlocalhost # cd /data/src/ro

7、otlocalhost src# touch file1.txt /新建测试文件rootlocalhost src# ls -l file1.txt /查看文件内容-rw-r-r- 1 nfsnobody nfsnobody 0 06-12 17:23 file1.txt再有:NFS服务端操作:rootdhcpser # chmod o+w /usr/src/ /添加目录属性增加写的权限NFS客户端操作:rootlocalhost # useradd tom 新建用户tomrootlocalhost # su tom 切换用户tomlocalhost $ cd /data/src/tomloc

8、alhost src$ touch tom1.txttomlocalhost src$ ls -l tom1.txt -rw-rw-r- 1 tom tom 0 06-12 17:29 tom1.txt 文件属主和属组都是TomNFS服务器修改主配置文件rootdhcpser # Vim /etc/exports /root 192.168.10.20(rw,sync,no_root_squash)/usr/src 192.168.10.0/24(rw,async,all_squash)rootdhcpser # exportfs -rv /重新发布信息NFS客户端操作: tomlocalhost

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论