nginx平滑升级实战
Nginx 平滑升级
1.查看旧版Nginx的编译参数
[root@master ~]# /usr/local/nginx/sbin/nginx -V
[root@master ~]# ll nginx*
-rw-r--r--. 1 root root 1015384 3月 19 10:45 nginx-1.14.2.tar.gz
-rw-r--r--. 1 root root 1032345 5月 29 19:42 nginx-1.16.0.tar.gz
2. 编译新版本Nginx源码包,安装路径需要与旧版一致,注意:不要执行make install
[root@master ~]# tar xf nginx-1.16.0.tar.gz -C /usr/src
[root@master ~]# cd /usr/src/nginx-1.16.0/
[root@master nginx-1.16.0]# ./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module --with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module && make
3. 备份二进制文件,用新版本的替换
[root@master nginx-1.16.0]# mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old
[root@master nginx-1.16.0]# ls
auto CHANGES.ru configure html Makefile objs src
CHANGES conf contrib LICENSE man README
[root@master nginx-1.16.0]# cp objs/nginx /usr/local/nginx/sbin
4. 确保配置文件无报错
[root@master nginx-1.16.0]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
5. 发送USR2信号
向主进程(master)发送USR2信号,Nginx会启动一个新版本的master进程和对应工作进程,和旧版一起处理请求
[root@master~]# ps -ef |grep nginx |grep -v grep
root 65388 1 0 17:07 ? 00:00:00 nginx: master process nginx
nginx 65389 65388 0 17:07 ? 00:00:00 nginx: worker process
[root@master ~]# kill -USR2 65388
6,发送WINCN信号
向旧的Nginx主进程(master)发送WINCH信号,他会逐步关闭自己的工作进程,这时所用请求都会有新版nginx处理
[root@master ~]# kill -WINCH 65388
[root@master~]# ps -ef |grep nginx |grep -v grep
root 65388 1 0 17:07 ? 00:00:00 nginx: master process nginx
现在查看部署已经升级完成,查看版本已经成功升级
[root@master~]# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.16.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module --with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module
7发送QUIT信号退出进程(等服务器不繁忙时可以相当于重启)
Kill -QUIT 65388
nginx平滑升级实战的更多相关文章
- Nginx平滑升级版本!(重点)
一.解释nginx的平滑升级 随着nginx越来越流行使用,并且nginx的优势也越来越明显,nginx的版本迭代也开始了加速模式,1.9.0版本的nginx更新了许多新功能,例如stream四层代理 ...
- 让你的网站免费支持 HTTPS 及 Nginx 平滑升级
为什么要使用 HTTPS ? 首先来说一下 HTTP 与 HTTPS 协议的区别吧,他们的根本区别就是 HTTPS 在 HTTP 协议的基础上加入了 SSL 层,在传输层对网络连接进行加密.简单点说在 ...
- Nginx range filter模块数字错误漏洞修复 (Nginx平滑升级) 【转】
对线上生产环境服务器进行漏洞扫描, 发现有两台前置机器存在Nginx range filter模块数字错误漏洞, 当使用nginx标准模块时,攻击者可以通过发送包含恶意构造range域的header ...
- Nginx range filter模块数字错误漏洞修复 (Nginx平滑升级)
对线上生产环境服务器进行漏洞扫描, 发现有两台前置机器存在Nginx range filter模块数字错误漏洞, 当使用nginx标准模块时,攻击者可以通过发送包含恶意构造range域的header ...
- 02 . Nginx平滑升级和虚拟主机
Nginx虚拟主机 在真实的服务器环境,为了充分利用服务器资源,一台nginx web服务器会同时配置N个虚拟主机,这样可以充分利用服务器的资源,方便管理员的统一管理 配置nginx虚拟主机有三种方法 ...
- Nginx平滑升级详细步骤-113p.cn
认识平滑升级 有时候我们需要对Nginx版本进行升级以满足运维人员对其功能的需求,例如添加xxx模块,需要xxx功能,而此时Nginx又在跑着业务无法停掉,这时我们就只能平滑升级了. 平滑升级原理 N ...
- Nginx 平滑升级、Nginx的一些基础配置
# Nginx 平滑升级 # 方案一:使用Nginx服务信号进行升级 # 1.将就版本的sbin目录下可执行nginx进行备份(mv nginx nginxold) # 2.将新版本 configur ...
- nginx 平滑升级tengine
wget http://tengine.taobao.org/download/tengine-1.5.1.tar.gz //下载Tengine1.5.1版本 tar zxvf tengine-1. ...
- Linux centos7 nginx 平滑升级
2021-08-19为了方便读者的阅读,该文通篇使用绝对路径,各位朋友们在实际上操作中可以根据实际情况编写路径(#^.^#)1. 当前环境 # system cat /etc/redhat-relea ...
随机推荐
- [转] CVonline: Image Databases
转自:CVonline by Robert Fisher 图像数据库 Index by Topic Action Databases Biological/Medical Face Databases ...
- ARP协议(4)ARP编程
之前的几篇文章,分别介绍了 ARP 协议格式,在vs2012里配置winpcap环境,我们该做的准备都已经做完了.如今我们真正来实现了. 一.定义数据结构 依据ARP的协议格式,设计一个ARP协议格式 ...
- Explicit Interface Implementation (C# Programming Guide)
https://msdn.microsoft.com/en-us/library/ms173157.aspx If a class implements two interfaces that con ...
- Python不兼容问题
今天遇到了一个Python2与3不兼容的坑. ride是基于robot框架的python自动化ui,但它只支持python2,而我电脑环境只有python3,想跑别人基于ride编写的测试用例,折腾了 ...
- 响应在此上下文中不可用 asp.net
(一)实例1: 在asp.net程序中添加了一个 类.cs 如下 using System; using System.Collections; using System.ComponentModel ...
- 转贴:CSS伪类与CSS伪元素的区别及由来具体说明
关于两者的区别,其实是很古老的问题.但是时至今日,由于各种网络误传以及一些不负责任的书籍误笔,仍然有相当多的人将伪类与伪元素混为一谈,甚至不乏很多CSS老手.早些年刚入行的时候,我自己也被深深误导,因 ...
- Oracle.ManagedDataAccess.dll
C#使用Oracle.ManagedDataAccess.dll System.Data.OracleClient程序集没有多大的不同,基本上拿以前使用System.Data.OracleClient ...
- JVM系列-类加载机制
简介 在java中,类的声明周期总共分为以下几种: 加载(Loading),验证(Verification),准备(Preparation),解析(Analysis), 初始化(Initializat ...
- 代码中特殊的注释技术——TODO、FIXME和XXX的用处 (转载)
转自:http://blog.csdn.net/reille/article/details/7161942 作者:reille 本博客网址:http://blog.csdn.net/reille/, ...
- Ruby和Swift的Range
意义 Swift Ruby [1, 2, 3, 4, 5] 1...5 1..5 [1, 2, 3, 4] 1..<5 1...5 ...