当前位置:网站首页>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文件加载最新的数据。
总结
边栏推荐
- 免费 DIY 之旅问题
- ctf (hardrce)
- warning package. Json: no license field error
- [brother hero June training] day 28: dynamic planning
- gyp ERR! configure error. gyp ERR! stack Error: gyp failed with exit code: 1
- Uninstall cuda11.1
- Based on LSM tree idea Net 6.0 C # write a kV database (case version)
- [brother hero June training] day 25: tree array
- A brief introduction to R language pipeline symbols (% >%) and placeholders (.)
- Oracle 11g manual memory management
猜你喜欢

Redis数据结构分析(二)

家庭琐事问题
![[Linux] mariadb/mysql scheduled full backup script and data recovery](/img/02/8ee01336a46e4956738f3cc8e30683.png)
[Linux] mariadb/mysql scheduled full backup script and data recovery

【Flink】Flink进行Standalone模式的集群搭建

How to turn off the application of computer self startup

Share machine learning notes (PDF version) + practical projects (dataset + code)

Preparation for Android interview (including the whole process of interview, interview preparation, interview questions and materials, etc.)

Metasploit Eternal Blue attack

怎样关闭电脑开机自启动的应用

游戏玩家问题
随机推荐
Matlab-绘制叠加阶梯图和线图
Matlab-创建 MATLAB的logo
[brother hero's June training] day 27: picture
wind10配置adb命令
Girl fan wants to find a boyfriend, but it's for
FTP server
File upload vulnerability bypass method
Loop traversal of foreach and some of ES6
文件上传漏洞绕过方法
数据库性能系列之子查询
Matlab/simulink sample sharing for solving differential equations
Ant advanced task
Matlab draws the system response under different damping
Word2vec principle and application and article similarity (recommended system method)
Program translation and execution, from editing, preprocessing, compilation, assembly, linking to execution
Matlab底层源代码实现图像的中值滤波(用于消除图像上一些杂点)
免费 DIY 之旅问题
【英雄哥六月集训】第 26天: 并查集
Metaaploit post penetration technology knowledge
gyp ERR! configure error. gyp ERR! stack Error: gyp failed with exit code: 1