首先我们将134资源通过NFS映射到135机器上
首先 134环境准备
- 安装nfs服务 使用命令 yum install -y nfs-utils
-
修改nfs配置在vim /etc/sysconfig/nfs里面修改
LOCKD_TCPPORT=50001 # TCP锁使用端口 LOCKD_UDPPORT=50002 # UDP锁使用端口 MOUNTD_PORT=50003 # 挂载使用端口
STATD_PORT=50004 # 状态使用端口
RDMA_PORT=50005
#配置映射及权限
#/data,本地文件路径
#10.10.10.135,允许挂载的IP,可以通过子网掩码进行网段批量设置
#(ro, sync, all_squash),ro只读权限,sync同步(文件同步写入到内存和磁盘当中),all_squash(限定权限)
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开放相关端口。
二、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.conf
location /feed/data/fullfeed
{
root /;
autoindex on; # for test
autoindex_exact_size on; # for test
autoindex_localtime on; # for test
}
来源:51CTO
作者:wx5c99daab1f230
链接:https://blog.51cto.com/14259169/2451348