You get a blue-green paper published, publication and gray rolling release

1 blue-green release

项目逻辑上分为AB组,在项目系统时,首先把A组从负载均衡中摘除,进行新版本的部署。B组仍然继续提供服务。

You get a blue-green paper published, publication and gray rolling release

当A组升级完毕,负载均衡重新接入A组,再把B组从负载列表中摘除,进行新版本的部署。A组重新提供服务。

You get a blue-green paper published, publication and gray rolling release

最后,B组也升级完成,负载均衡重新接入B组,此时,AB组版本都已经升级完成,并且都对外提供服务。

Feature

如果出问题,影响范围较大;
发布策略简单;
用户无感知,平滑过渡;
升级/回滚速度快。

Shortcoming

需要准备正常业务使用资源的两倍以上服务器,防止升级期间单组无法承载业务突发;
短时间内浪费一定资源成本;
基础设施无改动,增大升级稳定性。
蓝绿发布在早期物理服务器时代,还是比较昂贵的,由于云计算普及,成本也大大降低。

2 gray release

Gray publish upgrade only some of the services that allow some users to continue to use the old version, some users began to use the new version, if the user of the new version no opinion, then gradually expand the scope to all users to migrate to the new version of the above.
You get a blue-green paper published, publication and gray rolling release

Feature

保证整体系统稳定性,在初始灰度的时候就可以发现、调整问题,影响范围可控;
新功能逐步评估性能,稳定性和健康状况,如果出问题影响范围很小,相对用户体验也少;
用户无感知,平滑过渡。

Shortcoming

自动化要求高
部署过程
从LB摘掉灰度服务器,升级成功后再加入LB;
少量用户流量到新版本;
如果灰度服务器测试成功,升级剩余服务器。
灰度发布是通过切换线上并存版本之间的路由权重,逐步从一个版本切换为另一个版本的过程。

3 rolling release

Scroll Publishing is a time to upgrade one or more services, adding production environment after the upgrade is complete, the ongoing implementation of this process until all the old versions of the cluster upgrade the new version.
You get a blue-green paper published, publication and gray rolling release

红色:正在更新的实例;
蓝色:更新完成并加入集群的实例;
绿色:正在运行的实例。

Feature

用户无感知,平滑过渡;
节约资源。

Shortcoming

部署时间慢,取决于每阶段更新时间;
发布策略较复杂;
无法确定OK的环境,不易回滚。
部署过程
先升级1个副本,主要做部署验证;
每次升级副本,自动从LB上摘掉,升级成功后自动加入集群;
事先需要有自动更新策略,分为若干次,每次数量/百分比可配置;
回滚是发布的逆过程,先从LB摘掉新版本,再升级老版本,这个过程一般时间比较长;
自动化要求高。

summary

In summary, all can be done in three ways smooth upgrades, service during the upgrade process still maintain uninterrupted service, upgrades to the outside world is not aware of. That kind of deployment options most appropriate production methods? Depending on which method is best for your business and technical requirements. If you reserve enough capacity automated operation and maintenance, must be as simple as possible, it is recommended blue-green publishing, if business users rely on the strong recommendation of gray release. If K8S platform, rollover plan is ready, it is recommended to be used directly.

蓝绿发布:两套环境交替升级,旧版本保留一定时间便于回滚。

灰度发布:根据比例将老版本升级,例如80%用户访问是老版本,20%用户访问是新版本。

滚动发布:按批次停止老版本实例,启动新版本实例。

Guess you like

Origin blog.51cto.com/14013608/2442032