灰度上线说明文档

版权声明: https://blog.csdn.net/Liuboxx1/article/details/82463448

灰度上线说明文档

1、概念

灰度发布是指在黑与白之间,能够平滑过渡的一种发布方式。AB test就是一种灰度发布方式,让一部分用户继续用A,一部分用户开始用B,如果用户对B没有什么反对意见,那么逐步扩大范围,把所有用户都迁移到B上面来。灰度发布可以保证整体系统的稳定,在初始灰度的时候就可以发现、调整问题,以保证其影响度。

2、目前实现的方式有三种

  • Nginx+LUA方式
  • 根据Cookie实现灰度发布
  • 根据来路IP实现灰度发布

3、A/B测试流程

这里写图片描述

nginx设置说明

nginx目录

     nginx.conf   ---   vhost(dir)
                            |
                         xxx(dir)
                         /      \
               ab.release        admin.xxx.hbsaas.com.conf        

ab.release

    ###########灰色发布设置###########
    #设置 defaultRoot
    set $defaultRoot "/data1/wwwroot/default/";

    #设置 项目文件夹
    set $dirName "xxx/";
    if ($remote_addr ~ "1.202.70.198") {
        set $dirName "xxx180905/";
    }

    #设置 项目文件夹的绝对路径
    set $rootDir "${defaultRoot}${dirName}";

    #下面这些就得在各个配置文件中设置
    #set $webRoot "${defaultRoot}${dirName}huiyuan/backend/web";
    #root $webRoot;

admin.xxx.hbsaas.com.conf

#引入ab测试配置文件
include "./vhost/xxx/ab.release";
#下面{dirName}后面的路径是根据具体项目路径设置的,非固定
set $webRoot "${defaultRoot}${dirName}huiyuan/backend/web";
root $webRoot;

猜你喜欢

转载自blog.csdn.net/Liuboxx1/article/details/82463448