平滑处理.

78 篇文章 1 订阅
14 篇文章 0 订阅

平滑升级

1、获取现有的程序编译的参数 -V

[root@localhost nginx-1.20.1]# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.20.1
built by gcc 8.5.0 20210514 (Red Hat 8.5.0-3) (GCC) 
built with OpenSSL 1.1.1k  FIPS 25 Mar 2021
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --user=nginx --group=nginx --with-debug --with-http_ssl_module --with-http_realip_module --with-http_image_filter_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_stub_status_module --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log

2、获取新版本的软件包或者功能包

请添加图片描述

请添加图片描述
请添加图片描述

将软件包移到服务器中

[root@localhost ~]# ls
 echo-nginx-module-master.zip
 [root@localhost ~]# unzip echo-nginx-module-master.zip
 [root@localhost ~]# ls
echo-nginx-module-master echo-nginx-module-master.zip

3、将新功能或新版本进行编译

[root@localhost ~]# tar xf nginx-1.20.1.tar.gz 。
[root@localhost ~]# cd nginx-1.20.1/
[root@localhost nginx-1.20.1]# ./config --prefix=/usr/local/nginx --user=nginx --group=nginx --with-debug --with-http_ssl_module --with-http_realip_module --with-http_image_filter_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_stub_status_module --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --add-module=../echo-nginx-module-master  
//新添加 --add-module=../echo-nginx-module-master  
[root@localhost nginx-1.20.1]# make

编译安装完可以跟老版本进行对比

[root@localhost nginx-1.20.1]# ls objs/
addon         Makefile  nginx.8            ngx_auto_headers.h  ngx_modules.o
autoconf.err  nginx     ngx_auto_config.h  ngx_modules.c       src
[root@localhost nginx-1.20.1]# ll objs/nginx /usr/local/nginx/sbin/nginx 
-rwxr-xr-x. 1 root root 6831056 10月 27 15:56 objs/nginx
-rwxr-xr-x. 1 root root 6308640 10月 27 14:52 /usr/local/nginx/sbin/nginx

4、备份原程序

[root@localhost ~]# cp /usr/local/nginx/sbin/nginx /opt/

5、覆盖

[root@localhost nginx-1.20.1]# /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
[root@localhost nginx-1.20.1]# objs/
addon/ nginx  src/   
[root@localhost nginx-1.20.1]# objs/nginx -s stop ;/usr/local/nginx/sbin/nginx
[root@localhost nginx-1.20.1]# ps -ef |grep nginx
root      289782  289781  0 15:41 pts/3    00:00:00 /usr/libexec/pk-command-not-found nginx -V
root      518199       1  0 16:26 ?        00:00:00 nginx: master process /usr/local/nginx/sbin/nginx
nginx     518202  518199  0 16:26 ?        00:00:00 nginx: worker process
nginx     518203  518199  0 16:26 ?        00:00:00 nginx: worker process
nginx     518204  518199  0 16:26 ?        00:00:00 nginx: worker process
nginx     518205  518199  0 16:26 ?        00:00:00 nginx: worker process
root      519789  208227  0 16:26 pts/3    00:00:00 grep --color=auto nginx

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值