欢迎来到天天文库
浏览记录
ID:57689328
大小:21.00 KB
页数:5页
时间:2020-09-01
《NFS服务器的配置.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、NFS服务器的配置1.1NFS概述NFS是一种分布式文件系统允许网络中的安装不同的操作系统的计算机之间共享文件。我的安装环境:redhat5.9NFS服务器的主要软件包:nfs-utils-1.0.9-66.el5portmap-4.0-65.2.2.1系统服务脚本:NFSportmap主配置文件:/etc/exports、/etc/exports配置解析:--共享目录—客户机地址(参数,参数....)参数的介绍:Rw:可读可写Ro:只读Sync:同步写入:写入内存的同时写入硬盘Async:异步
2、写入:先写入内存在写入硬盘N0_root_squash:保留来之客户端的root权限All_squash:客户端的权限都降级为nfsnobody1.2NFS的安装[root@dhcpser~]#rpm-qnfs-utilsportmap//查看软件包是否安装nfs-utils-1.0.9-66.el5portmap-4.0-65.2.2.1如果没有安装可以利用yum库进行安装[root@dhcper~]#yum-yinstallnfs-utils[root@dhcper~]#yum-yinsta
3、llportmapNFS服务器端配置:[root@dhcpser~]#cat/etc/exports//编辑共享配置文件/root192.168.10.20(rw,sync,no_root_squash)共享/root给192.168.10.20,可写、同步,允许客户机以root权限访问[root@dhcpser~]#serviceportmaprestart//运行portmap脚本[root@dhcpser~]#servicenfsrestart//运行nfs脚本[root@dhcpser~
4、]#chkconfigportmapon//配置开机启动[root@dhcpser~]#chkconfignfson//配置开机启动客户端配置:[root@localhost~]#serviceportmaprestart//运行portmap脚本[root@localhost~]#showmount-e192.168.10.253//查看nfs共享列表Exportlistfor192.168.10.253:/root192.168.10.20//服务器端的共享[root@localhost~]
5、#mkdir-p/data/root///创建挂载目录[root@localhost~]#mount192.168.10.253:/root//data/root///挂载[root@localhost~]#df-hT
6、grepnfsnfs19G2.7G16G15%/data/root[root@localhost~]#cd/data/root/[root@localhostroot]#touchfile1.txt[root@localhostroot]#ls-lfile1.txt-rw-r--
7、r--1rootroot006-1217:18file1.txt例如:NFS服务器配置:[root@dhcpser~]#cat/etc/exports//编辑配置文件/root192.168.10.20(rw,sync,no_root_squash)/usr/src192.168.10.0/24(rw,async)//共享给10.0网段,可写,异步[root@dhcpser~]#exportfs-rv//重新发布信息[root@dhcpser~]#setfacl-mu:nfsnobody:rwx
8、/usr/src///添加读写权限客户端操作:[root@localhost~]#mkdir/data/src/创建挂载点[root@localhost~]#showmount-e192.168.10.253///查看共享Exportlistfor192.168.10.253:/root192.168.10.20/usr/src192.168.10.0/24[root@localhost~]#mount192.168.10.253:/usr/src//data/src/[root@localho
9、st~]#cd/data/src/[root@localhostsrc]#touchfile1.txt//新建测试文件[root@localhostsrc]#ls-lfile1.txt//查看文件内容-rw-r--r--1nfsnobodynfsnobody006-1217:23file1.txt再有:NFS服务端操作:[root@dhcpser~]#chmodo+w/usr/src///添加目录属性增加写的权限NFS客户端操作:[root@localhost~]#useraddtom新建用户t
此文档下载收益归作者所有