动静分离

动静分离

 

  1.创建NFS挂载点

    mkdir /static

    vim /etc/exports

      /static 172.16.1.0/20(rw,sync,all_squash,anonuid=666,anongid=666)

    systemctl restart nfs-server

    chown -R www.www /static/

 

  2.将静态资源放置于挂载点内

    mkdir /opt/static/s

    [root@web01 static]# cp -r /opt/bbs/static/* /opt/static/s/

 

  3.挂载到lb

    yum install nfs-utils -y

    mount -t nfs 172.16.1.31:/static /opt/static/

 

  4.测试

 

posted @ 2022-01-09 16:06  Snails蜗牛  阅读(44)  评论(0)    收藏  举报