nfs


配置服务器的三步:
第1步:设置静态IP
第2步:更改主机名
第3步:关闭防火墙和selinuc
# 清除防火墙配置,并停止
# iptables -F                 --临时清除防火墙
# /etc/init.d/iptables stop   --停止防火墙服务
# chkconfig iptables off      --设置防火墙开机不启动
# 关闭selinux
# vim /etc/selinux/cinfig
  7 SELINUX=disabled          --由enforcing改为disabled
---------------------
NFS网络文件系统搭建步骤:
---------------------
1、使用yum安装nfs软件包(10.1.1.10机器)
# yum -y install nfs*
安装好后:系统会产生共享配置文件/etc/exports 默认为空
        启动命令:/etc/init.d/rpcbind    --nfs远程调用服务,默认端口:111
                /etc/init.d/nfs        --nfs服务,默认端口:2049
2、配置共享目录/etc/exports
# vim /etc/exports
/test   *(ro)                                      --/test为共享目录,*为所有IP都可以访问,(ro)代表是访问的权限
/test1  *(rw)                                      --(rw)代表拥有读写访问权限
/test2  *(rw,no_root_squash)                       --(rw,no_root_squash)代客户端以root身份访问,且拥有读写权限
/test3  10.1.1.0/24(rw)                            --10.1.1.0/24(rw)代表只允许10.1.1.x的C网卡访问,且拥有读写权限
/test4  10.1.1.11(rw),10.1.1.12(rw,no_root_squash) --允许10.1.1.11访问,且拥有读写权限,允许10.1.1.12以root身份访问,且拥有读写权限
/test5  *(rw,anonuid=27,anongid=27)                --代表以用户id为27的用户访问,且拥有读写权限
3、配置文件写好后,启动服务
# /etc/init.d/rpcbind restart  --重启rpcbind远程调用服务
# /etc/init.d/nfs restart      --重启nfs服务
4、来到客户测试(10.1.1.11,10.1.1.12机器)
# showmount -e 10.1.1.10   --使用showmount -e 命令可列出服务器共享了哪些目录
4.1、挂载服务器共享的目录
  命令   服务器ip和共享目录  挂载到本地路径
# mount 10.1.1.10:/test   /test
---------------------
作者:qq547273855
来源:CSDN
原文:https://blog.csdn.net/qq547273855/article/details/78302926
版权声明:本文为博主原创文章,转载请附上博文链接!

posted on 2018-11-23 15:07  手写的博客  阅读(85)  评论(0编辑  收藏  举报

导航