我正在使用主管来守护我的django项目。如果我不从主管开始芹菜但是从shell (celery -A proj worker --app=proj.celery:app --loglevel=INFO)
开始一切正常。当我守护celery程序时,任务记录No such file or directory
并立即完成。
没有任何其他问题,工人还活着,supervisorctl
状态芹菜是RUNNING
等等问题是什么?
我的celery_err.log
文件内容:
[2018-04-08 15:24:01,121: INFO/MainProcess] Connected to redis://localhost:6379//
[2018-04-08 15:24:01,131: INFO/MainProcess] mingle: searching for neighbors
[2018-04-08 15:24:02,135: INFO/MainProcess] mingle: all alone
[2018-04-08 15:24:02,143: WARNING/MainProcess] /home/ali/Desktop/proj/projenv/local/lib/python2.7/site-packages/celery/fixups/django.py:265: UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in production environments!
warnings.warn('Using settings.DEBUG leads to a memory leak, never '
[2018-04-08 15:24:02,143: WARNING/MainProcess] celery@debian ready.
[2018-04-08 15:24:32,789: INFO/MainProcess] Received task: task_proj[441f7326-c847-4a29-a65d-543b8794e7a3]
[2018-04-08 15:24:32,797: INFO/Worker-2] task_proj[441f7326-c847-4a29-a65d-543b8794e7a3]: Sent scan request successfully
[2018-04-08 15:24:32,831: WARNING/Worker-2] [Errno 2] No such file or directory
[2018-04-08 15:24:32,843: WARNING/Worker-2] [Errno 2] No such file or directory
我的supervisord.conf
文件内容:
[program:proj]
environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8 ,PATH="/var/www/proj/projenv/bin", PROJ_ENV_FILE="/var/www/proj/proj.env",VIRTUAL_ENV="/var/www/proj/projenv",PYTHONPATH="/var/www/proj/projenv/lib/python:/var/www/proj/projenv/lib/python/site-packages"
command = /var/www/proj/bin/gunicorn_start
user = root
redirect_stderr = true
stdout_logfile=/var/www/proj/logs/django.log
stderr_logfile=/var/www/proj/logs/django_err.log
[program:redis]
command = /etc/redis-4.0.2/src/redis-server
[program:celery]
environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8 ,PATH="/var/www/proj/projenv/bin", PROJ_ENV_FILE="/var/www/proj/proj.env",VIRTUAL_ENV="/var/www/proj/projenv",PYTHONPATH="/var/www/proj/projenv/lib/python:/var/www/proj/projenv/lib/python/site-packages"
directory=/var/www/proj/proj
command = /var/www/proj/projenv/bin/celery -A proj worker --app=proj.celery:app --loglevel=INFO
user = root
redirect_stderr = true
stdout_logfile = /var/www/proj/logs/celery.log
stderr_logfile = /var/www/proj/logs/celery_err.log
autostart=true
autorestart=true
startsecs=10
stopwaitsecs=600
答案 0 :(得分:0)
Celery程序目录应该指向项目的根目录而不是基础应用程序。因此,directory=/var/www/proj/proj
应该是directory=/var/www/proj
,而不是type GraphQLError {
message: String
errorCode: Int
type: String
}
union MutationResult = Cat | GraphQLError
type Mutation {
createCat(name: String, age: Int): MutationResult
deleteCat(id: ID): MutationResult
}
。