zoukankan      html  css  js  c++  java
  • 2019.9.18 nfs共享与动静分离

    1,先把服务器A设置共享文件

    [root@localhost ~]# rpm -q nfs-utils rpcbind              //共享与被共享服务器都需要对应软件包 nfs-utils rpcbind 
    nfs-utils-1.3.0-0.48.el7.x86_64
    rpcbind-0.2.0-42.el7.x86_64
    [root@localhost ~]# mkdir /wwwroot                       //创建共享目录
    [root@localhost ~]# vim /etc/exports

      /wwwroot 192.168.200.111(rw)                //设置给哪些服务器共享
    [root@localhost ~]# systemctl restart rpcbind.socket           //重启
    [root@localhost ~]# systemctl restart nfs       //重启
    [root@localhost ~]# cd /wwwroot/
    [root@localhost wwwroot]# ls                          //之后就下载对应文件到共享目录下把吧
    [root@localhost wwwroot]# rz
    z waiting to receive.**B0100000023be50

    2,确保被共享服务器有对应软件包和挂载共享目录

    [root@localhost ~]# rpm -q nfs-utils rpcbind              //共享与被共享服务器都需要对应软件包 nfs-utils rpcbind 
    nfs-utils-1.3.0-0.48.el7.x86_64
    rpcbind-0.2.0-42.el7.x86_64

    [root@localhost ~]# showmount -e 192.168.200.113
    Export list for 192.168.200.113:                                          //查看共享信息
    /wwwroot 192.168.200.111

    [root@localhost ~]#  mkdir /usr/local/nginx/html/images     //创建挂载点

    [root@localhost ~]# mount 192.168.200.113:/wwwroot /usr/local/nginx/html/images/       //挂载共享目录

    1, 共需要3个服务器,一台是安装好了nginx,ip是192.168.200.112

     [root@nginx ~]# vim /usr/local/nginx/conf/nginx.conf

    location ~* .php$ {                                     //实现动态分离,别人在192.168.200.112上面访问/bbs/index.php 就跳转到192.168.200.111上面去                        
    proxy_pass http://192.168.200.111;
    }

    2,还有一台是搭建好了LNMP,ip是192.168.200.111

    }[root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf
    location ~ .php$ {
    root html;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    include fastcgi.conf;
    }

    }
    }

    3,还有一台是最上面配置好了nfs共享的服务器。

  • 相关阅读:
    linux运维、架构之路-Kubernetes离线、二进制部署集群
    linux运维、架构之路-Kubernetes集群部署
    创建SpringMVC项目过程
    Spring AOP使用方式
    Java动态代理
    Java工厂模式解耦 —— 理解Spring IOC
    Neural Turing Machine
    小米路由器mini刷锐捷
    目前深度学习开源数据集整理
    Spring编译后没有xml配置文件解决方法
  • 原文地址:https://www.cnblogs.com/otherwise/p/11545354.html
Copyright © 2011-2022 走看看