没有合适的资源?快使用搜索试试~ 我知道了~
首页1分钟搞定Nginx版本的平滑升级与回滚的方法
1分钟搞定Nginx版本的平滑升级与回滚的方法
6 下载量 2 浏览量
更新于2023-05-04
评论
收藏 88KB PDF 举报
今天,我们来聊一聊,在企业实际生产环境中经常遇到的一个情况,升级Nginx到新的版本和如何回滚至旧版本。 1、环境介绍 今天准备的两个nginx版本如下: [root@nginx ~]# cd /download/nginx/ [root@nginx nginx]# ll total 1952 -rw-r--r-- 1 root root 981687 Oct 17 2017 nginx-1.12.2.tar.gz -rw-r--r-- 1 root root 1015384 Dec 4 09:58 nginx-1.14.2.tar.gz 2、编译安装新旧版本 编译安装nginx-1.12
资源详情
资源评论
资源推荐
1分钟搞定分钟搞定Nginx版本的平滑升级与回滚的方法版本的平滑升级与回滚的方法
今天,我们来聊一聊,在企业实际生产环境中经常遇到的一个情况,升级Nginx到新的版本和如何回滚至旧版本。
1、环境介绍、环境介绍
今天准备的两个nginx版本如下:
[root@nginx ~]# cd /download/nginx/
[root@nginx nginx]# ll
total 1952
-rw-r--r-- 1 root root 981687 Oct 17 2017 nginx-1.12.2.tar.gz
-rw-r--r-- 1 root root 1015384 Dec 4 09:58 nginx-1.14.2.tar.gz
2、编译安装新旧版本、编译安装新旧版本
编译安装nginx-1.12.2
[root@nginx nginx]# tar zxf nginx-1.12.2.tar.gz
[root@nginx nginx]# cd nginx-1.12.2
[root@nginx nginx-1.12.2]# ./configure --prefix=/usr/local/nginx-1.12.2
[root@nginx nginx-1.12.2]# echo $?
0
[root@nginx nginx-1.12.2]# make && make install
[root@nginx nginx-1.12.2]# echo $?
0
[root@nginx nginx-1.12.2]# ll /usr/local/nginx-1.12.2/
total 0
drwxr-xr-x 2 root root 333 Mar 1 09:01 conf
drwxr-xr-x 2 root root 40 Mar 1 09:01 html
drwxr-xr-x 2 root root 6 Mar 1 09:01 logs
drwxr-xr-x 2 root root 19 Mar 1 09:01 sbin
编译安装nginx-1.14.2
[root@nginx ~]# cd /download/nginx/
[root@nginx nginx]# tar zxf nginx-1.14.2.tar.gz
[root@nginx nginx]# cd nginx-1.14.2
[root@nginx nginx-1.14.2]# ./configure --prefix=/usr/local/nginx-1.14.2
[root@nginx nginx-1.14.2]# echo $?
0
[root@nginx nginx-1.14.2]# make && make install
[root@nginx nginx-1.14.2]# echo $?
0
[root@nginx nginx-1.14.2]# ls -l /usr/local/nginx-1.14.2/
total 0
drwxr-xr-x 2 root root 333 Mar 1 09:03 conf
drwxr-xr-x 2 root root 40 Mar 1 09:03 html
drwxr-xr-x 2 root root 6 Mar 1 09:03 logs
drwxr-xr-x 2 root root 19 Mar 1 09:03 sbin
到这里,两个版本的nginx软件已经部署完成。
3、启动旧版本、启动旧版本nginx
[root@nginx ~]# /usr/local/nginx-1.12.2/sbin/nginx -t
nginx: the configuration file /usr/local/nginx-1.12.2/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx-1.12.2/conf/nginx.conf test is successful
[root@nginx ~]# /usr/local/nginx-1.12.2/sbin/nginx
[root@nginx ~]# ps -ef|grep nginx
root 6324 1 0 09:06 ? 00:00:00 nginx: master process /usr/local/nginx-1.12.2/sbin/nginx
nobody 6325 6324 0 09:06 ? 00:00:00 nginx: worker process
root 6327 1244 0 09:06 pts/0 00:00:00 grep --color=auto nginx
[root@nginx ~]# lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 6324 root 6u IPv4 26324 0t0 TCP *:http (LISTEN)
nginx 6325 nobody 6u IPv4 26324 0t0 TCP *:http (LISTEN)
4、升级到新版本、升级到新版本
版本升级其实就是针对二进制文件的升级,过程如下:
[root@nginx ~]# /usr/local/nginx-1.12.2/sbin/nginx -v
weixin_38606076
- 粉丝: 4
- 资源: 944
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- zigbee-cluster-library-specification
- JSBSim Reference Manual
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0