为什么我用supervisor管理gunicorn会自动退出?
Why do I use supervisor managed gunicorn automatically quit?
我用 supervisor 管理的 gunicorn 会自动 exit.This 是我用 Python3.Hope 构建的 Flask 项目来得到你的帮助。
启动指令为:
sudo supervisord -c /etc/supervisor/conf.d/app.conf
日志:
[2017-10-24 08:41:15 +0000] [10357] [INFO] Starting gunicorn 19.7.1
[2017-10-24 08:41:15 +0000] [10357] [INFO] Listening at: http://0.0.0.0:8000 (10357)
[2017-10-24 08:41:15 +0000] [10357] [INFO] Using worker: sync
[2017-10-24 08:41:15 +0000] [10360] [INFO] Booting worker with pid: 10360
[2017-10-24 08:41:16 +0000] [10362] [INFO] Booting worker with pid: 10362
[2017-10-24 08:41:16 +0000] [10364] [INFO] Booting worker with pid: 10364
[2017-10-24 08:41:16 +0000] [10366] [INFO] Booting worker with pid: 10366
[2017-10-24 08:41:54 +0000] [10357] [INFO] Handling signal: term
[2017-10-24 08:41:54 +0000] [10360] [INFO] Worker exiting (pid: 10360)
[2017-10-24 08:41:54 +0000] [10362] [INFO] Worker exiting (pid: 10362)
[2017-10-24 08:41:54 +0000] [10366] [INFO] Worker exiting (pid: 10366)
[2017-10-24 08:41:54 +0000] [10364] [INFO] Worker exiting (pid: 10364)
[2017-10-24 08:41:54 +0000] [10357] [INFO] Shutting down: Master
主管配置:
[program:app]
directory = /home/ubuntu/Flask-Blog/
command = /home/ubuntu/Flask-Blog/venv/bin/gunicorn -w4 -b0.0.0.0:8000 manage:app
autostart = true
startsecs = 5
autorestart = true
startretries = 3
user = ubuntu
redirect_stderr = true
stdout_logfile_maxbytes = 50MB
stdout_logfile_backups = 20
stdout_logfile = /home/ubuntu/Flask-Blog/log/gunicorn.log
stder_logfile = /home/ubuntu/Flask-Blog/log/gunicorn.err
stopasgroup = false
killasgroup = false
[supervisorctl]
[supervisord]
[inet_http_server]
port = 127.0.0.1:9001
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
我重新安装并重新配置了配置文件。应该是我在配置过程中出错了
sudo supervisord -c /etc/supervisor/conf.d 使用这个命令会自动退出
我用 supervisor 管理的 gunicorn 会自动 exit.This 是我用 Python3.Hope 构建的 Flask 项目来得到你的帮助。 启动指令为:
sudo supervisord -c /etc/supervisor/conf.d/app.conf
日志:
[2017-10-24 08:41:15 +0000] [10357] [INFO] Starting gunicorn 19.7.1
[2017-10-24 08:41:15 +0000] [10357] [INFO] Listening at: http://0.0.0.0:8000 (10357)
[2017-10-24 08:41:15 +0000] [10357] [INFO] Using worker: sync
[2017-10-24 08:41:15 +0000] [10360] [INFO] Booting worker with pid: 10360
[2017-10-24 08:41:16 +0000] [10362] [INFO] Booting worker with pid: 10362
[2017-10-24 08:41:16 +0000] [10364] [INFO] Booting worker with pid: 10364
[2017-10-24 08:41:16 +0000] [10366] [INFO] Booting worker with pid: 10366
[2017-10-24 08:41:54 +0000] [10357] [INFO] Handling signal: term
[2017-10-24 08:41:54 +0000] [10360] [INFO] Worker exiting (pid: 10360)
[2017-10-24 08:41:54 +0000] [10362] [INFO] Worker exiting (pid: 10362)
[2017-10-24 08:41:54 +0000] [10366] [INFO] Worker exiting (pid: 10366)
[2017-10-24 08:41:54 +0000] [10364] [INFO] Worker exiting (pid: 10364)
[2017-10-24 08:41:54 +0000] [10357] [INFO] Shutting down: Master
主管配置:
[program:app]
directory = /home/ubuntu/Flask-Blog/
command = /home/ubuntu/Flask-Blog/venv/bin/gunicorn -w4 -b0.0.0.0:8000 manage:app
autostart = true
startsecs = 5
autorestart = true
startretries = 3
user = ubuntu
redirect_stderr = true
stdout_logfile_maxbytes = 50MB
stdout_logfile_backups = 20
stdout_logfile = /home/ubuntu/Flask-Blog/log/gunicorn.log
stder_logfile = /home/ubuntu/Flask-Blog/log/gunicorn.err
stopasgroup = false
killasgroup = false
[supervisorctl]
[supervisord]
[inet_http_server]
port = 127.0.0.1:9001
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
我重新安装并重新配置了配置文件。应该是我在配置过程中出错了
sudo supervisord -c /etc/supervisor/conf.d 使用这个命令会自动退出