gpt4 book ai didi

design-patterns - 红/黑部署和蓝/绿部署有什么区别?

转载 作者:行者123 更新时间:2023-12-03 06:48:49 28 4
gpt4 key购买 nike

我听说两者都用来描述在新计算机上部署更新,同时保持旧计算机处于事件状态,以便在出现问题时准备回滚的想法。我还听说它用来描述更新服务和旧服务之间的共享负载,同样是为了回滚——有时终止不活动的旧补丁,有时则不终止。

我的理解是,它严格适用于云服务。

有人可以帮助揭开这些术语的神秘面纱吗?

最佳答案

蓝绿部署

Continuous Delivery 中描述的经典部署技术Jez Humble 和 David Farley 所著的书:

The idea is to have two identical versions of your production environment, whichwe’ll call blue and green... Users of the system are routed to the green environment, which is the currently designated production. We want to release a new version of the application. So we deploy it to the blue environment... This does not in any way affect the operation of the green environment. We can run smoke tests against the blue environment to check it is working properly. When we’re ready, moving to the new version is as simple as changing the router configuration to point to the blue environment instead of the green environment. The blue environment thus becomes production. This switchover can typically be performed in much less than a second. If something goes wrong, we simply switch the router back to the green environment.'

Humble 和 Farley 然后继续提到主要挑战:处理绿色版本和蓝色版本之间的数据库架构更改。

蓝绿部署的主要好处是发布新版本时停机时间为零或接近零。蓝绿部署支持金丝雀发布。

红黑部署

红色版本已投入生产。您将黑色版本部署到一台或多台服务器。当黑色版本完全运行时,您可以切换路由器以将所有流量定向到它(或者将红色扩展到 0 个实例,将黑色扩展到 N 个实例)。如果出现任何问题,您可以恢复操作。因此,它与蓝绿部署类似,但有一点细微的差别:在蓝绿部署中,两个版本可能会暂时同时获取请求,而在红黑部署中,只有一个版本获取流量在任何时间点。这是一些corroboration :

At any time, only one of the environments is live, with the live environment serving all production traffic. For this example, Red is currently live and Black is idle (in this case we have kept the Black down-scaled to zero servers)...

因此,红黑是蓝绿的特化。但红黑部署是 Netflix、Istio 和其他支持容器编排的框架/平台使用的一个较新术语。 实际含义可能有所不同,许多人将“红黑”用作“蓝绿”的另一个术语,可能只是因为他们的团队颜色是红色和黑色。 :^)

关于design-patterns - 红/黑部署和蓝/绿部署有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45259589/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com