国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > Nginx > 正文

詳解nginx平滑升級的過程

2024-08-30 12:22:43
字體:
來源:轉載
供稿:網友
這篇文章主要介紹了詳解nginx平滑升級的過程,小編覺得挺不錯的,現在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧

1、開始之前首先查看當前的使用版本以及編譯時的參數:

[root@www ~]# /usr/local/nginx/sbin/nginx -Vnginx version: nginx/1.12.2built by gcc 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC) built with OpenSSL 1.0.1e-fips 11 Feb 2013TLS SNI support enabledconfigure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module

將編譯參數復制出來,編譯新版本的時候會用到。

2、下載新版本:http://nginx.org/en/download.html

cd nginx-1.14.0./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_modulemake

3、執行完成之后,不需要make install ,備份原來的二進制啟動文件,然后將新版的啟動文件拷貝過去

mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak[root@www nginx-1.14.0]# cp objs/nginx /usr/local/nginx/sbin/nginx

4、測試一下復制過來的文件是否生效:

[root@www nginx-1.14.0]# /usr/local/nginx/sbin/nginx -tnginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is oknginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

5、發送USR2信號給nginx master 進程(nginx服務接收到USR2信號后,首先會將舊的nginx.pid文件添加后綴.oldbin,變為nginx.pid.oldbin,然后執行新版本的二進制文件啟動服務,如果新的服務啟動成功,系統中將有新舊兩個Nginx服務共同提供web服務)

kill -USR2 `cat /usr/local/nginx/logs/nginx.pid`[root@www nginx-1.14.0]# ps -ef | grep nginx root   22644   1 0 23:30 ?    00:00:00 nginx: master process /usr/local/nginx/sbin/nginxwww   22648 22644 0 23:30 ?    00:00:00 nginx: worker process   root   25784 22644 0 23:47 ?    00:00:00 nginx: master process /usr/local/nginx/sbin/nginxwww   25789 25784 0 23:47 ?    00:00:00 nginx: worker process  

6、通過發送WINCH信號(平緩停止worker process)和QUIT信號(平緩停止Nginx服務)停止舊的Nginx服務進程

kill -WINCH `cat /usr/local/nginx/logs/nginx.pid.oldbin` kill -QUIT `cat /usr/local/nginx/logs/nginx.pid.oldbin`  

7、升級完成,最后看一下nginx版本:

/usr/local/nginx/sbin/nginx -vnginx version: nginx/1.14.0

武林網之家提示您:這篇文章你看完了!

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 开平市| 邮箱| 龙川县| 那曲县| 京山县| 岗巴县| 鹰潭市| 洛浦县| 嘉定区| 贺州市| 新乡县| 隆化县| 玛曲县| 师宗县| 原阳县| 建宁县| 明水县| 开阳县| 东乡族自治县| 中山市| 溧阳市| 柳林县| 汝南县| 岳池县| 彭州市| 西乡县| 静安区| 宿州市| 彭泽县| 南陵县| 江西省| 海丰县| 乾安县| 方山县| 石阡县| 扶余县| 闽侯县| 屏南县| 邳州市| 伊金霍洛旗| 封开县|