Chinaunix首页 | 论坛 | 博客
  • 博客访问: 211252
  • 博文数量: 109
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 890
  • 用 户 组: 普通用户
  • 注册时间: 2014-03-24 17:06
文章分类

全部博文(109)

文章存档

2015年(1)

2014年(108)

分类: 系统运维

2014-06-17 18:06:00

为nginx平滑升级在make upgrate那一步除了点小状况

1
2
3
4
5
6
7
8
9
[root@web01 nginx-1.0.5]# make upgrade
/usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
kill -USR2 `cat /usr/local/nginx/logs/nginx.pid`
sleep 1
test -f /usr/local/nginx/logs/nginx.pid.oldbin
make: *** [upgrade] 错误 1
[root@web01 nginx-1.0.5]#


找不到进程文件出错,无法进行下一步


再次启动脚本,有如下提示


1
2
3
4
5
6
7
[root@web01 sbin]# ./nginxold
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: still could not bind()

这步是说80端口被使用


我也不清楚为什么nginx启动了却没有进程文件。

所以先把nginx kill掉,重新启动


1
2
3
[root@web01 sbin]# pkill -int nginx
[root@web01 sbin]# ./nginxold   
[root@web01 sbin]#



接着make upgrate就成功了升级


1
2
3
4
5
6
7
8
9
10
[root@web01 nginx-1.0.5]# make upgrade
/usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
kill -USR2 `cat /usr/local/nginx/logs/nginx.pid`
sleep 1
test -f /usr/local/nginx/logs/nginx.pid.oldbin
kill -QUIT `cat /usr/local/nginx/logs/nginx.pid.oldbin`
[root@web01 nginx-1.0.5]#
[root@web01 nginx-1.0.5]#



注:如果在执行make upgrade命令出现错误,修改下Makefile中的upgrade标签下的路径,修改为正确的Nginx可执行文件的路径,CENTOS下一般是/usr/local/nginx/sbin/nginx



阅读(4346) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~