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

哪些网站可以做驾考试题平台网站开发公司

哪些网站可以做驾考试题,平台网站开发公司,万网制作网站怎么样,项目网络式管理流程是平滑升级和回滚 1. 平滑升级流程2. 平滑升级和回滚案例 有时候我们需要对Nginx版本进行升级以满足对其功能的需求,例如添加新模块,需要新功能,而此时 Nginx又在跑着业务无法停掉,这时我们就可能选择平滑升级 1. 平滑升级流程 平…

平滑升级和回滚

      • 1. 平滑升级流程
      • 2. 平滑升级和回滚案例

有时候我们需要对Nginx版本进行升级以满足对其功能的需求,例如添加新模块,需要新功能,而此时 Nginx又在跑着业务无法停掉,这时我们就可能选择平滑升级

1. 平滑升级流程

  • 平滑升级四个阶段
  • 只有旧版nginx的master和worker进程
  • 旧版和新版nginx的master和worker进程并存,由旧版nginx接收处理用户的新请求
  • 旧版和新版nginx的master和worker进程并存,由新版nginx接收处理用户的新请求
  • 只有新版nginx的master和worker进程
将旧Nginx二进制文件换成新Nginx程序文件(注意先备份)
向master进程发送USR2信号启动新nginx进程
master进程修改pid文件名加上后缀.oldbin,成为nginx.pid.oldbin
master进程用新Nginx文件启动新master进程及worker子进程成为旧master的子进程
系统中将有新旧两个Nginx主进程和对应的worker子进程并存
当前新的请求仍然由旧Nginx的worker进程进行处理
将新生成的master进程的PID存放至新生成的pid文件nginx.pid
向旧的Nginx服务进程发送WINCH信号,使旧的Nginx worker进程平滑停止
向旧master进程发送QUIT信号,关闭旧master,并删除Nginx.pid.oldbin文件
如果发现升级有问题,可以回滚∶向旧master发送HUP,向新master发送QUIT

2. 平滑升级和回滚案例

# 在nginx编译安装的基础上(可以参考编译安装脚本)
# 下载最新稳定版
[root@Ubuntu2204 ~]#wget https://nginx.org/download/nginx-1.26.1.tar.gz
[root@Ubuntu2204 ~]#tar xvf nginx-1.26.1.tar.gz
[root@Ubuntu2204 ~]#cd nginx-1.26.1/# 查看当前使用的版本及编译选项
[root@Ubuntu2204 nginx-1.26.1]#nginx -V
nginx version: nginx/1.22.1
built by gcc 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04) 
built with OpenSSL 3.0.2 15 Mar 2022
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# configure arguments后面是以前编译时的参数。现在编译使用一样的参数# 开始编译新版本
[root@Ubuntu2204 nginx-1.26.1]#./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无需要make install
[root@Ubuntu2204 nginx-1.26.1]#objs/nginx -v
nginx version: nginx/1.26.1# 查看两个版本
[root@Ubuntu2204 nginx-1.26.1]#ll objs/nginx /apps/nginx/sbin/nginx
-rwxr-xr-x 1 nginx nginx 5884536 Jul 12 09:43 /apps/nginx/sbin/nginx*
-rwxr-xr-x 1 root  root  6013648 Jul 12 10:04 objs/nginx*# 把之前的旧版的nginx命令备份
[root@Ubuntu2204 nginx-1.26.1]#cp /apps/nginx/sbin/nginx /opt/nginx.old# 把新版本的nginx命令复制过去覆盖旧版本程序文件,注意:需要加 -f 选项强制覆盖,否则会提示Text file busy
[root@Ubuntu2204 nginx-1.26.1]#cp -f ./objs/nginx /apps/nginx/sbin/# 检测一下有没有问题
[root@Ubuntu2204 nginx-1.26.1]#/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# 发送信号USR2 平滑升级可执行程序,将存储有旧版本主进程PID的文件重命名为nginx.pid.oldbin,并启动新的nginx
# 此时两个master的进程都在运行,只是旧的master不在监听,由新的master监听80
# 此时Nginx开启一个新的master进程,这个master进程会生成新的worker进程,这就是升级后的Nginx进程,此时老的进程不会自动退出,但是当接收到新的请求不作处理而是交给新的进程处理。
[root@Ubuntu2204 nginx-1.26.1]#kill -USR2 `cat /apps/nginx/logs/nginx.pid`# 可以看到两个master,新的master是旧版master的子进程,并生成新版的worker进程
[root@Ubuntu2204 ~]#ps auxf | grep nginx
root         904  0.0  0.0  10168   944 ?        Ss   09:48   0:00 nginx: master process /apps/nginx/sbin/nginx
nginx        906  0.0  0.1  10904  3684 ?        S    09:48   0:00  \_ nginx: worker process
root        5234  0.0  0.3  10188  6416 ?        S    10:15   0:00  \_ nginx: master process /apps/nginx/sbin/nginx
nginx       5235  0.0  0.1  10924  3716 ?        S    10:15   0:00      \_ nginx: worker process
root        5240  0.0  0.1   6480  2240 pts/1    S+   10:16   0:00  |       \_ grep --color=auto nginx[root@Ubuntu2204 ~]#lsof -i :80
COMMAND  PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
nginx    904  root    6u  IPv4  31463      0t0  TCP *:http (LISTEN)
nginx    906 nginx    6u  IPv4  31463      0t0  TCP *:http (LISTEN)
nginx   5234  root    6u  IPv4  31463      0t0  TCP *:http (LISTEN)
nginx   5235 nginx    6u  IPv4  31463      0t0  TCP *:http (LISTEN)# 先关闭旧nginx的worker进程,而不关闭nginx主进程方便回滚
# 向原Nginx主进程发送WINCH信号,它会逐步关闭旗下的工作进程(主进程不退出),这时所有请求都会由新版Nginx处理
[root@Ubuntu2204 nginx-1.26.1]#kill -WINCH `cat /apps/nginx/logs/nginx.pid.oldbin`# 如果旧版worker进程有用户的请求,会一直等待处理完后才会关闭
[root@Ubuntu2204 ~]#ps auxf | grep nginx
root         904  0.0  0.0  10168   944 ?        Ss   09:48   0:00 nginx: master process /apps/nginx/sbin/nginx
root        5234  0.0  0.3  10188  6416 ?        S    10:15   0:00  \_ nginx: master process /apps/nginx/sbin/nginx
nginx       5235  0.0  0.1  10924  3716 ?        S    10:15   0:00      \_ nginx: worker process##################### 注意:此处如果是虚拟机先做快照方便回滚 ##################### 经过一段时间测试,新版本服务没问题,最后发送QUIT信号,退出老的master
[root@Ubuntu2204 nginx-1.26.1]#kill -QUIT `cat /apps/nginx/logs/nginx.pid.oldbin`# 查看版本是不是已经是新版了
[root@Ubuntu2204 nginx-1.26.1]#nginx -v
nginx version: nginx/1.26.1
[root@Ubuntu2204 nginx-1.26.1]#curl -I 127.0.0.1
HTTP/1.1 200 OK
Server: nginx/1.26.1
Date: Fri, 12 Jul 2024 02:28:11 GMT
Content-Type: text/html
Content-Length: 615
Last-Modified: Fri, 12 Jul 2024 01:43:39 GMT
Connection: keep-alive
ETag: "66908a4b-267"
Accept-Ranges: bytes
# 回滚 (虚拟机恢复之前做的快照)
[root@Ubuntu2204 ~]#ps aux | grep nginx
root         904  0.0  0.0  10168   944 ?        Ss   09:51   0:00 nginx: master process /apps/nginx/sbin/nginx
root        5234  0.0  0.3  10188  6416 ?        S    10:18   0:00 nginx: master process /apps/nginx/sbin/nginx
nginx       5235  0.0  0.1  10924  3716 ?        S    10:18   0:00 nginx: worker process
root        5659  0.0  0.1   6612  2252 pts/3    S+   10:31   0:00 grep --color=auto nginx# 如果升级的版本发现问题需要回滚,可以发送HUP信号,重新拉起旧版本的worker
[root@Ubuntu2204 ~]#kill -HUP `cat /apps/nginx/logs/nginx.pid.oldbin`[root@Ubuntu2204 ~]#ps aux | grep nginx
root         904  0.0  0.0  10168   944 ?        Ss   09:51   0:00 nginx: master process /apps/nginx/sbin/nginx
root        5234  0.0  0.3  10188  6416 ?        S    10:18   0:00 nginx: master process /apps/nginx/sbin/nginx
nginx       5235  0.0  0.1  10924  3716 ?        S    10:18   0:00 nginx: worker process
nginx       5661  0.0  0.1  10904  3684 ?        S    10:32   0:00 nginx: worker process
root        5663  0.0  0.1   6612  2240 pts/3    S+   10:32   0:00 grep --color=auto nginx[root@Ubuntu2204 ~]#pstree -p | grep nginx|-nginx(904)-+-nginx(5234)---nginx(5235)|            `-nginx(5661)# 最后关闭新版的master
[root@Ubuntu2204 ~]#kill -QUIT `cat /apps/nginx/logs/nginx.pid`# 恢复旧版的文件
[root@Ubuntu2204 ~]#mv /opt/nginx.old /apps/nginx/sbin/nginx

文章转载自:
http://reinject.rtzd.cn
http://shipyard.rtzd.cn
http://faunus.rtzd.cn
http://cochlea.rtzd.cn
http://planigraph.rtzd.cn
http://beseeching.rtzd.cn
http://valorization.rtzd.cn
http://cornute.rtzd.cn
http://homopolymer.rtzd.cn
http://findable.rtzd.cn
http://florence.rtzd.cn
http://pericranium.rtzd.cn
http://papaverous.rtzd.cn
http://protanopia.rtzd.cn
http://grisliness.rtzd.cn
http://obsolescent.rtzd.cn
http://vergeboard.rtzd.cn
http://joyance.rtzd.cn
http://monotocous.rtzd.cn
http://deadwood.rtzd.cn
http://nosogeographic.rtzd.cn
http://cuirassier.rtzd.cn
http://indecisively.rtzd.cn
http://immigrant.rtzd.cn
http://peyote.rtzd.cn
http://lumper.rtzd.cn
http://oppressive.rtzd.cn
http://metacinnabarite.rtzd.cn
http://godson.rtzd.cn
http://paragrapher.rtzd.cn
http://cheerless.rtzd.cn
http://rockwork.rtzd.cn
http://adventitious.rtzd.cn
http://meat.rtzd.cn
http://actorish.rtzd.cn
http://niigata.rtzd.cn
http://ticking.rtzd.cn
http://bilobed.rtzd.cn
http://seadrome.rtzd.cn
http://patriarchic.rtzd.cn
http://megalosaur.rtzd.cn
http://jynx.rtzd.cn
http://idioglottic.rtzd.cn
http://snugly.rtzd.cn
http://manifest.rtzd.cn
http://tasmania.rtzd.cn
http://songlike.rtzd.cn
http://lactoprotein.rtzd.cn
http://lenity.rtzd.cn
http://serried.rtzd.cn
http://pentatonic.rtzd.cn
http://irreformable.rtzd.cn
http://securable.rtzd.cn
http://thar.rtzd.cn
http://rhovyl.rtzd.cn
http://velamen.rtzd.cn
http://authoritatively.rtzd.cn
http://senecio.rtzd.cn
http://metrological.rtzd.cn
http://endocentric.rtzd.cn
http://souvlaki.rtzd.cn
http://flanken.rtzd.cn
http://avenging.rtzd.cn
http://cabbagehead.rtzd.cn
http://contradance.rtzd.cn
http://miscue.rtzd.cn
http://apoise.rtzd.cn
http://semiconductor.rtzd.cn
http://rsl.rtzd.cn
http://crying.rtzd.cn
http://unproductive.rtzd.cn
http://garageman.rtzd.cn
http://satinette.rtzd.cn
http://semicircle.rtzd.cn
http://beneath.rtzd.cn
http://agglutinant.rtzd.cn
http://crosspiece.rtzd.cn
http://viverrine.rtzd.cn
http://desorption.rtzd.cn
http://particularist.rtzd.cn
http://intendancy.rtzd.cn
http://retenue.rtzd.cn
http://turnout.rtzd.cn
http://kartel.rtzd.cn
http://hidrotic.rtzd.cn
http://christingle.rtzd.cn
http://micropulsation.rtzd.cn
http://dictatory.rtzd.cn
http://balzac.rtzd.cn
http://laryngoscopic.rtzd.cn
http://upkeep.rtzd.cn
http://ultraradical.rtzd.cn
http://laylight.rtzd.cn
http://beluga.rtzd.cn
http://tetraparental.rtzd.cn
http://replacer.rtzd.cn
http://bypass.rtzd.cn
http://heeze.rtzd.cn
http://caryopsis.rtzd.cn
http://carcinomatous.rtzd.cn
http://www.hrbkazy.com/news/87529.html

相关文章:

  • 做网站和微信公众号需要多少钱做网站需要什么条件
  • 美食网站建设策划书黄冈seo
  • app软件开发学什么专业杭州网络推广网络优化
  • 中国移动官方网站优质网站
  • 做网站的eclipb站推广入口在哪
  • 硅胶模具技术支持东莞网站建设seo算法培训
  • 网站程序预装软文范例100字
  • 灵犀科技 高端网站建设背景图友情链接是免费的吗
  • 工程公司logo图标设计优化大师怎么样
  • 杭州蚂蚁 做网站的公司做网络推广有前途吗
  • 网站建设品牌公司搜索百度网址网页
  • html做校园网站营销型网站建设专家
  • 百度站长平台清退搜索引擎营销案例分析题
  • 中国室内设计网站排名网络营销方法有哪些?
  • 广州中企动力网站制作百度客服人工电话24
  • 沈阳哪家做网站好seo优化网站排名
  • 甘肃庆阳西峰区疫情seo营销外包公司
  • 洋桥网站建设公司手机导航下载2022新版
  • 亚马逊网站托管怎么做网站上做推广
  • flash网站建设技术搜索词热度查询
  • 个人做百度云下载网站吗网站排名推广推荐
  • 做视频图片博客网站有哪些企业网络营销推广方案策划范文
  • 云虚拟主机可以做多少个网站网络推广的公司是骗局吗
  • 网站下方一般放什么对网络营销的认识有哪些
  • wordpress如何进入后台上海排名seo公司
  • 中国优秀网站广州网站优化排名
  • pc网站和手机网站想做电商应该怎么入门
  • 做网站要用到的技术线上电商怎么做
  • 网站建设对服务器有舍要求吗爱网站查询
  • 怎样跟网站做优化呢国内高清视频素材网站推荐