主管无法运行Gunicorn命令

时间:2018-11-09 03:10:52

标签: python nginx server gunicorn supervisor

我有一个可以从目录成功运行的命令。

/home/ubuntu/.local/bin/gunicorn marbles.wsgi:application -b -0.0.0.0:8000 &

运行

/home/ubuntu/Marble/MibsBackEnd/marble-project/marbles/

并启动我的服务器没问题。

我试图让主管为我运行此程序,以使其保持生命。这是我的配置文件

[supervisord]
logfile=/tmp/supervisord.log
logfile_maxbytes=50MB

[program:marbles]
command=/home/ubuntu/.local/bin/gunicorn marbles.wsgi:application -b-0.0.0.0:8000 &
directory=/home/ubuntu/Marble/MarbleBackEnd/marble-project/marbles/

[program:test]
command=python -u test.py
directory=/home/ubuntu/Marble/MarbleBackEnd/marble-project/marbles/

主管启动时,出现此错误

BACKOFF Exited too quickly (process log may have details)

和日志文件打印出来

2018-11-09 02:51:29,051 CRIT Supervisor running as root (no user in config file)
2018-11-09 02:51:29,051 INFO Included extra file "/etc/supervisor/conf.d/marbles.conf" during parsing
2018-11-09 02:51:29,058 INFO RPC interface 'supervisor' initialized
2018-11-09 02:51:29,058 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2018-11-09 02:51:29,058 INFO supervisord started with pid 21985
2018-11-09 02:51:30,060 INFO spawned: 'test' with pid 22012
2018-11-09 02:51:30,062 INFO spawned: 'marbles' with pid 22013
2018-11-09 02:51:30,074 INFO exited: marbles (exit status 1; not expected)
2018-11-09 02:51:31,076 INFO success: test entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2018-11-09 02:51:31,077 INFO spawned: 'marbles' with pid 22014
2018-11-09 02:51:31,090 INFO exited: marbles (exit status 1; not expected)
2018-11-09 02:51:33,091 INFO spawned: 'marbles' with pid 22017
2018-11-09 02:51:33,103 INFO exited: marbles (exit status 1; not expected)
2018-11-09 02:51:36,639 INFO spawned: 'marbles' with pid 22021
2018-11-09 02:51:36,652 INFO exited: marbles (exit status 1; not expected)
2018-11-09 02:51:37,048 INFO gave up: marbles entered FATAL state, too many start retries too quickly
2018-11-09 02:53:57,467 INFO waiting for test to die

在同一位置有一个测试文件,主管可以毫无问题地启动它。该文件仅打印到屏幕上。 我认为该问题与我尝试运行的gunicorn命令有关,但在搜索所有其他答案后无效。

感谢您的帮助!

编辑:

这是Gunicorn日志文件:

Traceback (most recent call last): File "/home/ubuntu/.local/bin/gunicorn", line 7, in <module> from gunicorn.app.wsgiapp import run ImportError: No module named gunicorn.app.wsgiapp

0 个答案:

没有答案