主管nginx:[emerg] bind()到0.0.0.0:80失败(98:地址已经在使用中)

时间:2016-04-20 07:52:03

标签: nginx supervisord

我搜索其他关于此标题的帖子 但我找不到解决这个问题的解决方案。

我的 CentOS7 主机上有两个泊坞广告。 一个用于烧瓶应用,另一个用于 jupyterhub

现在有一个错误: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) 以下是一些提示信息

  

lsof -i:80
  我想也许这就是问题,但我不知道如何解决它。

[root@localhost ~]# lsof -i :80
COMMAND PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
nginx   683  root    6u  IPv4  15547      0t0  TCP *:http (LISTEN)
nginx   683  root    7u  IPv6  15548      0t0  TCP *:http (LISTEN)
nginx   685 nginx    6u  IPv4  15547      0t0  TCP *:http (LISTEN)
nginx   685 nginx    7u  IPv6  15548      0t0  TCP *:http (LISTEN)
  

/etc/supervisord.conf

[program:app]            
command=/home/flaskproject/venv/bin/gunicorn -w 4 -b 0.0.0.0:6008 manage:app
directory=/home/flaskproject
startsecs=0
stopwaitsecs=0
autostart=true
autorestart=true
stdout_logfile=/home/flaskproject/log/gunicorn.log
stderr_logfile=/home/flaskproject/log/gunicorn.err


[program:nginx]
command=/usr/sbin/nginx -g "daemon off;"
startsecs=0
stopwaitsecs=0
autostart=true
autorestart=true
stdout_logfile=/home/flaskproject/log/nginx.log
stderr_logfile=/home/flaskproject/log/nginx.err
  

tail -n 30 /etc/supervisord.log

[root@localhost conf.d]# tail -n 30 /tmp/supervisord.log  
2016-04-20 15:23:34,176 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2016-04-20 15:23:36,678 INFO exited: nginx (exit status 1; not expected)
2016-04-20 15:23:37,680 INFO spawned: 'nginx' with pid 16672
2016-04-20 15:23:37,691 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2016-04-20 15:23:40,192 INFO exited: nginx (exit status 1; not expected)
2016-04-20 15:23:41,195 INFO spawned: 'nginx' with pid 16675
2016-04-20 15:23:41,205 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2016-04-20 15:23:43,706 INFO exited: nginx (exit status 1; not expected)
2016-04-20 15:23:44,709 INFO spawned: 'nginx' with pid 16676
2016-04-20 15:23:44,719 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2016-04-20 15:23:47,222 INFO exited: nginx (exit status 1; not expected)
2016-04-20 15:23:47,819 INFO spawned: 'nginx' with pid 16782
2016-04-20 15:23:47,822 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2016-04-20 15:23:47,822 INFO waiting for nginx, manage to die
2016-04-20 15:23:47,822 WARN killing 'manage' (682) with SIGKILL
2016-04-20 15:23:47,834 WARN killing 'manage' (682) with SIGKILL
2016-04-20 15:23:47,834 INFO stopped: manage (terminated by SIGKILL)
2016-04-20 15:23:47,837 WARN killing 'nginx' (16782) with SIGKILL
2016-04-20 15:23:47,837 WARN received SIGTERM indicating exit request
2016-04-20 15:23:47,837 WARN killing 'nginx' (16782) with SIGKILL
2016-04-20 15:23:47,837 INFO stopped: nginx (terminated by SIGTERM)
2016-04-20 15:24:18,949 CRIT Supervisor running as root (no user in config file)
2016-04-20 15:24:19,292 INFO RPC interface 'supervisor' initialized
2016-04-20 15:24:19,292 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2016-04-20 15:24:19,293 INFO daemonizing the supervisord process
  

tail -f /var/log/nginx/error.log

[root@localhost ~]# tail -f /var/log/nginx/error.log
2016/04/20 15:49:19 [emerg] 2442#0: bind() to [::]:80 failed (98: Address already in use)
2016/04/20 15:49:19 [emerg] 2442#0: bind() to 0.0.0.0:8008 failed (98: Address already in use)
2016/04/20 15:49:19 [emerg] 2442#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2016/04/20 15:49:19 [emerg] 2442#0: bind() to [::]:80 failed (98: Address already in use)
2016/04/20 15:49:19 [emerg] 2442#0: bind() to 0.0.0.0:8008 failed (98: Address already in use)
2016/04/20 15:49:19 [emerg] 2442#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2016/04/20 15:49:19 [emerg] 2442#0: bind() to [::]:80 failed (98: Address already in use)
2016/04/20 15:49:19 [emerg] 2442#0: bind() to 0.0.0.0:8008 failed (98: Address already in use)
2016/04/20 15:49:19 [emerg] 2442#0: still could not bind()

0 个答案:

没有答案