http://blog.youkuaiyun.com/kassadinsw/article/details/72833103
接上篇文章。
修改nfs配置文件 建立共享目录
[root@localhost bak]# vim /etc/exports
/bak 192.168.16.0/24(rw,sync,fsid=0)
修改共享目录的权限
chmod -R o+w /bak
对主机进行操作
将sdb1挂载在 /bak共享目录上
[root@localhost bak]# cp /usr/local/nginx-1.12.0/html/index.html /bak/index11.html[root@localhost nginx-1.12.0]# echo "asahsajhs" >>/bak/index11.html
将主机的/bak文件夹挂载在从机的/bak文件夹
[root@localhost ~]# mount 192.168.16.110:/bak /bak
修改从机的nginx.conf
location / {
#root html;
root /bak;#在这里加一行
index index11.html;#这个Index11.html是主机的共享目录
}
重启服务
完成任务