解决重启后nginx无法启动,并导致网站无法打开的问题

[服务器加速] – 解决重启后nginx无法启动,并导致网站无法打开的问题

1
2
3
4
5
6
7
Oct 01 18:08:47 izj6cha39b7w1bxlm0ldcjz systemd[1]: Starting LSB: starts the nginx web server...
Oct 01 18:08:47 izj6cha39b7w1bxlm0ldcjz nginx[2772]: Starting nginx... nginx (pid 819) already running.
Oct 01 18:08:47 izj6cha39b7w1bxlm0ldcjz systemd[1]: nginx.service: control process exited, code=exited status=1
Oct 01 18:08:47 izj6cha39b7w1bxlm0ldcjz systemd[1]: Failed to start LSB: starts the nginx web server.
Oct 01 18:08:47 izj6cha39b7w1bxlm0ldcjz systemd[1]: Unit nginx.service entered failed state.
Oct 01 18:08:47 izj6cha39b7w1bxlm0ldcjz systemd[1]: nginx.service failed.
Oct 01 18:08:52 izj6cha39b7w1bxlm0ldcjz nginx[770]: Starting nginx...

原因:
https://zls.chinastonetops.com/?p=962 ,重装ngx_pagespeed时操作失误导致.

1. 手动处理 – 复杂
1-1. 查询nginx主进程号

1
ps -ef | grep nginx

会出现

1
2
3
4
root      2755     1  0 18:30 ?        00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
www       2756  2755  0 18:30 ?        00:00:00 nginx: worker process
www       2757  2755  0 18:30 ?        00:00:00 nginx: worker process
root      2763  2736  0 18:34 pts/0    00:00:00 grep --color=auto nginx

1-2. kill 重复的进程

1
kill 2755

1-3. 重启nginx

1
2
systemctl restart nginx
systemctl status nginx


1-4. 2核的就会有两个worker process 进程,1核的只有一个worker process进程


这个确实是双核就有,不是ngx_pagespeed重装导致
2核4G内存系统刚装好时就已经有2个work process .而已重启网站正常.nginx也正常

Leave a Reply

Your email address will not be published. Required fields are marked *