nginx平滑升级(1.14--1.15)
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了nginx平滑升级(1.14--1.15),小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2123字,纯文字阅读大概需要4分钟。
内容图文
![nginx平滑升级(1.14--1.15)](/upload/InfoBanner/zyjiaocheng/972/3e3a8800e7df45338cf16bf4ee774485.jpg)
- 查看旧版nginx编译参数
[root@localhost yum.repos.d]# nginx -V
nginx version: nginx/1.14.2
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_modu
le --with-http_gzip_static_module
[root@localhost yum.repos.d]# ps aux | grep nginx
root 80809 0.0 0.1 47024 1912 ? Ss 12:10 0:00 nginx: master process nginx
nginx 80810 0.0 2.2 69760 22652 ? S 12:10 0:00 nginx: worker process
nginx 80811 0.0 2.2 69760 22652 ? S 12:10 0:00 nginx: worker process
备份旧版本
[root@localhost yum.repos.d]# strings /usr/local/nginx/sbin/nginx.old
- 安装新版本的nginx(不要执行make install)
[root@localhost ~]# tar zxf nginx-1.15.9.tar.gz -C /usr/src/
[root@localhost nginx-1.15.9]# ./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
#和nginx -V 查看的所编译的要相同
[root@localhost nginx-1.15.9]# cp objs/nginx /usr/local/nginx/sbin/nginx
#使用新的二进制文件代替旧的
[root@localhost nginx-1.15.9]# 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
#查看配置文件是否正常
[root@localhost nginx-1.15.9]# nginx -V
#如一切环境正常,可以看到版本号已经修改为新的了
- 发送USR2信号
[root@localhost nginx-1.15.9]# kill -USR2 80809
#向主进程(master)发送 USR2 信号,Nginx 会启动一个新版本的master进程和对应工作进程,和旧版一起处理请求
[root@localhost nginx-1.15.9]# ps aux | grep nginx
[root@localhost ~]# kill -WINCH 80809
#向旧的 Nginx 主进程(master)发送 WINCH信号,它会逐步关闭自己的工作进程(主进程不退出),这时所有请求都会由新版 Nginx 处理
[root@localhost ~]# kill -QUIT 80809
#向旧的 Nginx 主进程(master)发送(QUIT、TERM、或者 KILL)信号,使旧的主进程退出
[root@localhost nginx-1.15.9]# nginx -v
nginx version: nginx/1.15.9
#测试查看版本号
over……
内容总结
以上是互联网集市为您收集整理的nginx平滑升级(1.14--1.15)全部内容,希望文章能够帮你解决nginx平滑升级(1.14--1.15)所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。