当前位置:网站首页>WEB服务如何平滑的上下线
WEB服务如何平滑的上下线
2022-07-27 10:10:00 【InfoQ】
背景
Nginx配置管理

Nginx 配置按照更新频率主要分为4个模块:
- 基本配置信息、event、http 属于更新频率最低的main-conf
- 更新频率极低的证书
- server、location 属于更新频率较低的server-conf
- 更新频率超高的upstream配置
Nginx 配置修改发布的大致流程:
- 在管理平台修改nginx配置
- 启动docker 拉取对应配置
- 测试配置是否符合预期
- 发布配置到线上集群
- 线上nginx 集群使用 nginx reload 使配置生效
基于Nginx dyups模块的动态上下线
服务路由策略上线&更新
- 在一个新服务上线或既有服务路由逻辑发生变更的时候,运维会在nginx上新增server,并关联对应的upstream。
- 服务部署好并启动,在启动完成后,发布系统会调用nginx的上线接口,将服务IP新增或者更新到upstream中,服务就可以提供访问。

服务更新
- 在发布系统,将一个服务设为下线,此时发布系统会调用nginx的下线接口,将指定服务器的IP设置为下线。
- 在nginx摘除指定节点后,回调发布系统,就可以开始更新服务站点。
- 更新完毕后,再设为上线,此时发布系统会调用nginx的上线接口,将指定服务器的IP设置为上线。

服务运行期间
遇到的问题
落地实践

- 通过队列将发布系统基于指定节点的上下线转换为全量upstream。
- 通过锁和flush保证nginx 内存中的upstream和文件一致,当Nginx重载配置时,它会从upstream文件加载最新的数据。
总结
边栏推荐
猜你喜欢

Samba server

Robotframework+eclispe environment installation

pytorch中对BatchNorm2d()函数的理解

程序的翻译和执行,从编辑、预处理、编译、汇编、链接到执行

简单几步教您实现为工业树莓派共享网络

About new_ Online_ Judge_ 1081_ Thoughts on Goldbach's conjecture

Multipoint bidirectional republication and routing strategy

Two architectures of ETL (ETL architecture and ELT Architecture)

Xiandai 004

Metaaploit-后渗透技知识
随机推荐
Metaaploit post penetration technology knowledge
FTP 服务器
A brief introduction to R language pipeline symbols (% >%) and placeholders (.)
NVIDIA geforce experience login error: the verifier failed to load. Please check your browser settings, such as the advertisement interceptor (solution)
Matlab底层源代码实现图像的中值滤波(用于消除图像上一些杂点)
hdu5289(Assignment)
Girl fan wants to find a boyfriend, but it's for
Different binary conversion of MATLAB
Based on LSM tree idea Net 6.0 C # write a kV database (case version)
File upload vulnerability bypass method
Matlab-创建文字云
hdu5288(OO’s Sequence)
Metaspolit
游戏玩家问题
Mathematical reasoning: five couples get together and shake hands when they meet
Warning: remote head references to nonexistent ref, unable to checkout error messages
warning package.json: No license field报错
Ant advanced task
Matlab-离散事件系统仿真实验
FTP server