[root@h102 sbin]# kill -HUP `cat /usr/local/nginx/logs/nginx.pid.oldbin`
[root@h102 sbin]# ps fuax | grep nginx
root 5748 0.0 0.0 103256 828 pts/0 S+ 20:49 0:00 \_ grep nginx
root 5500 0.0 0.0 24316 852 ? Ss 20:01 0:00 nginx: master process sbin/nginx -c conf/nginx.conf
root 5651 0.0 0.0 24316 1820 ? S 20:23 0:00 \_ nginx: master process sbin/nginx -c conf/nginx.conf
nobody 5653 0.0 0.0 24740 1532 ? S 20:23 0:00 | \_ nginx: worker process
nobody 5746 0.0 0.0 24728 1244 ? S 20:49 0:00 \_ nginx: worker process
[root@h102 sbin]#
[root@h102 sbin]# kill -WINCH `cat /usr/local/nginx/logs/nginx.pid.oldbin`
[root@h102 sbin]# ps fuax | grep nginx
root 5759 0.0 0.0 103256 828 pts/0 S+ 20:52 0:00 \_ grep nginx
root 5500 0.0 0.0 24316 852 ? Ss 20:01 0:00 nginx: master process sbin/nginx -c conf/nginx.conf
root 5651 0.0 0.0 24316 1820 ? S 20:23 0:00 \_ nginx: master process sbin/nginx -c conf/nginx.conf
nobody 5653 0.0 0.0 24740 1532 ? S 20:23 0:00 \_ nginx: worker process
[root@h102 sbin]# kill -QUIT `cat /usr/local/nginx/logs/nginx.pid.oldbin`
[root@h102 sbin]# ps fuax | grep nginx
root 5762 0.0 0.0 103256 828 pts/0 S+ 20:52 0:00 \_ grep nginx
root 5651 0.0 0.0 24316 1820 ? S 20:23 0:00 nginx: master process sbin/nginx -c conf/nginx.conf
nobody 5653 0.0 0.0 24740 1532 ? S 20:23 0:00 \_ nginx: worker process
[root@h102 sbin]#
版本切换成功,整个切换过程服务都是可用状态
Tip: 有没有注意到其实我是在进行版本降级 从 nginx-1.9.5 降到了 nginx-1.8.0 ,所以其实和版本是否更新无关,可以更新也可以更旧
原文地址http://soft.dog/2015/10/09/nginx-basic/
本文系转载,前往查看
如有侵权,请联系?cloudcommunity@tencent.com 删除。
本文系转载,前往查看
如有侵权,请联系?cloudcommunity@tencent.com 删除。