zoukankan      html  css  js  c++  java
  • 线上平滑升级nginx1.12

    1、下载相关包,需要和之前用到的依赖包保持一致
    
    wget http://nginx.org/download/nginx-1.12.2.tar.gz
    wget https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/08a395c66e42.zip
    wget https://github.com/yaoweibin/nginx_upstream_check_module/archive/master.zip
    
    2、解压并备份之前的版本
    
    tar xf nginx-1.12.2.tar.gz 
    unzip master.zip 
    unzip 08a395c66e42.zip 
    cd /application/
    cp -rp nginx1.12.1/ nginx.bak
    
    3、查看当前版本使用的编译参数
    
    ./nginx -V
    
    configure arguments: --user=nginx --group=nginx --prefix=/application/nginx1.12.1 --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module --add-module=../nginx-goodies-nginx-sticky-module-ng-08a395c66e42 --add-module=../nginx_upstream_check_module-master
    
    4、编译安装
    
    cd nginx-1.12.2
    
    patch -p1 < ../nginx_upstream_check_module-master/check_1.12.1+.patch
    
    ./configure --user=nginx --group=nginx --prefix=/application/nginx1.12.1 --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module --add-module=../nginx-goodies-nginx-sticky-module-ng-08a395c66e42 --add-module=../nginx_upstream_check_module-master
    
    make  #此步不要make install
    
    5、拷贝新的启动文件
    
    cd /application/nginx/sbin/
    mv nginx nginx1_12_1
    cp ~/nginx-1.12.2/objs/nginx .
    
    6、检查是否成功,并平滑关闭
    
    ./nginx -t
    
    nginx: the configuration file /application/nginx1.12.1/conf/nginx.conf syntax is ok
    nginx: configuration file /application/nginx1.12.1/conf/nginx.conf test is successful
    
    
    kill -USR2 `cat /application/nginx/logs/nginx.pid`
    kill -QUIT `cat /application/nginx/logs/nginx.pid.oldbin`
    
    7、查看升级后的版本
    
    ./nginx -v
    nginx version: nginx/1.12.2
  • 相关阅读:
    zoj 3593 One Person Game
    poj 2115 C Looooops
    hdu 1576 A/B
    hdu 2669 Romantic
    poj1006 Biorhythms
    中国剩余定理(孙子定理)
    Pseudoprime numbers---费马小定理
    青蛙的约会----POJ1061
    [POJ2942]:Knights of the Round Table(塔尖+二分图染色法)
    [BZOJ1718]:[Usaco2006 Jan] Redundant Paths 分离的路径(塔尖)
  • 原文地址:https://www.cnblogs.com/dukuan/p/8064331.html
Copyright © 2011-2022 走看看