当前位置: 首页 > wzjs >正文

襄阳手机网站建设天堂网

襄阳手机网站建设,天堂网,做网站可以用别人的源码吗,关于做面包的网站文章目录 1、nginx平滑升级1.1 平滑升级的应用场景和意义 2、平滑升级的操作2.1 安装 nginx1.20.22.2 平滑升级操作2.3 平滑回滚 3、总结 1、nginx平滑升级 1.1 平滑升级的应用场景和意义 Nginx平滑升级具有重要意义与广泛的应用场景。在意义层面,它可在不中断服务…

文章目录

  • 1、nginx平滑升级
    • 1.1 平滑升级的应用场景和意义
  • 2、平滑升级的操作
    • 2.1 安装 nginx1.20.2
    • 2.2 平滑升级操作
    • 2.3 平滑回滚
  • 3、总结


1、nginx平滑升级

1.1 平滑升级的应用场景和意义

Nginx平滑升级具有重要意义与广泛的应用场景。在意义层面,它可在不中断服务的前提下完成版本更新,避免因服务暂停导致的用户访问中断、业务损失及影响用户体验,同时能让新版本的功能、性能优化和安全补丁及时生效,增强服务器稳定性与安全性,还可减少运维操作复杂度和对业务的干扰,提升系统可用性。在应用场景方面,当Nginx新版本引入关键功能(如更高效的负载均衡算法、新协议支持)时,平滑升级能让业务快速受益;面对已知安全漏洞,可通过平滑升级及时修复,降低被攻击风险;当业务流量增长,需利用新版本性能优化(如连接处理优化、内存管理改进)提升服务器处理能力时,平滑升级可在不中断服务的情况下实现;此外,在需要对Nginx配置进行重大调整或模块升级时,平滑升级能确保调整过程中服务持续可用,避免因配置变更导致的服务中断问题。

2、平滑升级的操作

2.1 安装 nginx1.20.2

   #拖入相关的安装包24  yum -y install gcc pcre-devel openssl-devel zlib-devel openssl openssl-devel#安装依赖环境25  useradd -M -s /sbin/nologin nginx#创建nginx用户便于管理26  ls27  tar -xf nginx-1.20.2.tar.gz 28  ls29  cd nginx-1.20.2/30  l31  ls32  ./configure --prefix=/apps/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre --with-stream --with-stream_ssl_module --with-stream_realip_module#指定编译路径,以及可能用得到的模块33  vim /etc/profile34  source /etc/profile#声明nginx的环境变量35  nginx -v36  vim /etc/profile37  ls38  make -j2 && make install#编译安装39  nginx -v
[root@localhost nginx-1.20.2]# 

查看安装的版本为1.20.2

[root@localhost nginx-1.20.2]# nginx -v
nginx version: nginx/1.20.2
[root@localhost nginx-1.20.2]# nginx -V
nginx version: nginx/1.20.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/apps/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre --with-stream --with-stream_ssl_module --with-stream_realip_module
[root@localhost nginx-1.20.2]# 

2.2 平滑升级操作

[root@localhost ~]# cd /opt/
[root@localhost opt]# ls
rh
[root@localhost opt]# rz -E
rz waiting to receive.
[root@localhost opt]# ls
nginx-1.28.0.tar.gz  rh
#拖入安装包
[root@localhost opt]# tar -xf nginx-1.28.0.tar.gz 
[root@localhost opt]# ls
nginx-1.28.0  nginx-1.28.0.tar.gz  rh
[root@localhost opt]# cd nginx-1.28.0/
[root@localhost nginx-1.28.0]# ls
auto        CODE_OF_CONDUCT.md  contrib          LICENSE    SECURITY.md
CHANGES     conf                CONTRIBUTING.md  man        src
CHANGES.ru  configure           html             README.md
[root@localhost nginx-1.28.0]# ./configure --prefix=/apps/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre --with-stream --with-stream_ssl_module --with-stream_realip_module
#需要和上面低版本的模块一样

编译(注意只能编译)make -j2

[root@localhost nginx-1.28.0]# ls
auto        CODE_OF_CONDUCT.md  contrib          LICENSE   objs         src
CHANGES     conf                CONTRIBUTING.md  Makefile  README.md
CHANGES.ru  configure           html             man       SECURITY.md
[root@localhost nginx-1.28.0]# make -j2

复制nginx的执行文件到相应的位置

[root@localhost nginx-1.28.0]# ls
auto        CODE_OF_CONDUCT.md  contrib          LICENSE   objs         src
CHANGES     conf                CONTRIBUTING.md  Makefile  README.md
CHANGES.ru  configure           html             man       SECURITY.md[root@localhost nginx-1.28.0]# cd objs/
#进入obj目录
[root@localhost objs]# ls
autoconf.err  nginx    ngx_auto_config.h   ngx_modules.c  src
Makefile      nginx.8  ngx_auto_headers.h  ngx_modules.o
#找到nginx的执行文件
[root@localhost objs]# cd /apps/nginx/sbin/
[root@localhost sbin]# ls
nginx
[root@localhost sbin]# mv nginx nginx.old
#备份原来的执行文件为nginx.old
[root@localhost sbin]# cd -
/opt/nginx-1.28.0/objs
[root@localhost objs]# ls
autoconf.err  nginx    ngx_auto_config.h   ngx_modules.c  src
Makefile      nginx.8  ngx_auto_headers.h  ngx_modules.o
[root@localhost objs]# mv nginx /apps/nginx/sbin/
#把高版本的nginx可执行文件移动到低版本的工作目录
[root@localhost objs]# ls /apps/nginx/sbin/
nginx  nginx.old
[root@localhost objs]# 

make upgrade操作

[root@localhost objs]# cd /opt/nginx-1.28.0/
[root@localhost nginx-1.28.0]# ls
auto        CODE_OF_CONDUCT.md  contrib          LICENSE   objs         src
CHANGES     conf                CONTRIBUTING.md  Makefile  README.md
CHANGES.ru  configure           html             man       SECURITY.md
[root@localhost nginx-1.28.0]# 
#需要切换到nginx的文件夹目录[root@localhost nginx-1.28.0]# make upgrade
/apps/nginx/sbin/nginx -t
nginx: the configuration file /apps/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /apps/nginx/conf/nginx.conf test is successful
kill -USR2 `cat /apps/nginx/logs/nginx.pid`
sleep 1
test -f /apps/nginx/logs/nginx.pid.oldbin
kill -QUIT `cat /apps/nginx/logs/nginx.pid.oldbin`
[root@localhost nginx-1.28.0]# nginx -v
nginx version: nginx/1.28.0
[root@localhost nginx-1.28.0]# 
#此时我们就完成了升级

2.3 平滑回滚

在上面的基础上,回滚操作就显得很容易了

[root@localhost nginx-1.28.0]# cd /apps/nginx/sbin/
[root@localhost sbin]# ls
nginx  nginx.old
#进入目录
[root@localhost sbin]# mv nginx nginx.1.28
[root@localhost sbin]# ls
nginx.1.28  nginx.old
[root@localhost sbin]# mv nginx.old nginx.
[root@localhost sbin]# mv nginx. nginx
[root@localhost sbin]# ls
nginx  nginx.1.28
#更改nginx可执行文件的名称
[root@localhost sbin]# ls
nginx  nginx.1.28
[root@localhost sbin]# cd /opt/nginx-1.28.0/
#进入nginx文件目录
[root@localhost nginx-1.28.0]# make upgrade
/apps/nginx/sbin/nginx -t
nginx: the configuration file /apps/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /apps/nginx/conf/nginx.conf test is successful
kill -USR2 `cat /apps/nginx/logs/nginx.pid`
sleep 1
test -f /apps/nginx/logs/nginx.pid.oldbin
kill -QUIT `cat /apps/nginx/logs/nginx.pid.oldbin`
#make upgrade成功
[root@localhost nginx-1.28.0]# nginx -v
nginx version: nginx/1.20.2
#查看版本是否回滚成功
[root@localhost nginx-1.28.0]# 

3、总结

通过nginx的执行文件可以决定nginx运行的版本,更换nginx的执行文件可以实现nginx版本的升级和回滚。

http://www.dtcms.com/wzjs/470710.html

相关文章:

  • 国外室内设计案例网站太原网站建设
  • 宿州酒店网站建设百度指数平台
  • 网站开发专业有什么工作腾讯朋友圈广告代理
  • wordpress 浮动广告泰州seo排名扣费
  • 网站制作知识线上线下整合营销方案
  • 自己不会代码让别人做网站怎么管理福州网站开发公司
  • 南宁市建设委员会网站经典seo伪原创
  • 运动 网站专题怎么做网站seo优化心得
  • 手机网站建设公司推荐金昌网站seo
  • h5建设网站媒体:北京不再公布各区疫情数据
  • wordpress 主题库360seo优化
  • 哪些园林网站可以做外链十大seo免费软件
  • 做网站和做网页一样吗网页版登录入口
  • 南联网站建设推广新网域名
  • 中国建设银行网站E路护航官网seo建站平台哪家好
  • 西北苗木网陕西泽基生态建设有限公司网站十大外贸平台
  • 网站手机端首页用什么软件做aso安卓优化公司
  • 网站微信二维码侧边栏漂浮框长沙网站seo诊断
  • 做网站准备的资料长沙谷歌优化
  • 合肥网站开发公司电话店铺如何运营和推广
  • 国家年报个体户工商营业执照广州网站优化排名系统
  • 新网站如何做百度收录电商平台的营销方式
  • 我是做颗粒在什么网站上seo基础教程
  • 芜湖做网站都有哪些网络营销工具包括
  • 交互式网站制作seo推广培训资料
  • 有中文网站 怎么做英文网站广州信息流推广公司
  • 网站规划与设计一千字新网站如何让百度收录
  • seo关键词挖掘工具西安seo关键字优化
  • 网站统计 中文域名seo信息是什么
  • 北京建设学院网站苏州网站制作开发公司