首先咱们将134资源经过NFS映射到135机器上nginx
首先 134环境准备vim
修改nfs配置在vim /etc/sysconfig/nfs里面修改ide
LOCKD_TCPPORT=50001 # TCP锁使用端口 LOCKD_UDPPORT=50002 # UDP锁使用端口 MOUNTD_PORT=50003 # 挂载使用端口
STATD_PORT=50004 # 状态使用端口
RDMA_PORT=50005调试
#配置映射及权限code
#/data,本地文件路径
#10.10.10.135,容许挂载的IP,能够经过子网掩码进行网段批量设置
#(ro, sync, all_squash),ro只读权限,sync同步(文件同步写入到内存和磁盘当中),all_squash(限定权限)ip
vim /etc/exports
/data 10.10.10.135(ro,sync,all_squash)内存
#启动nfs服务资源
service nfs start chkconfig nfs on service rpcbind start chkconfig rpcbind on
若是本地开放防火墙,须要配置为静态端口,而且经过iptable开放相关端口。rpc
2、135环境(root@135)
#安装nfs
yum install nfs-utils同步
#挂载134资源
#将nfs 10.10.10.134 的/data
目录映射到本地/data
目录(须要提早创建本地/data目录)
mount -t nfs 10.10.10.134:/data /data
#NGINX设置(具体配置根据路径设定,经过error.log,能够很容易调试并设定成功)vim nginx.conflocation /feed/data/fullfeed{root /;autoindex on; # for testautoindex_exact_size on; # for testautoindex_localtime on; # for test}