如何解决我的以下问题,芹菜生产设置错误

时间:2020-04-21 05:18:11

标签: django linux bash ubuntu celery

嗨,我正在尝试在生产环境中设置django和celery。

这是我的/etc/conf.d/celery文件。

CELERYD_NODES="w1"
CELERY_BIN="/home/.../env/bin/celery"


CELERY_APP="projectname"

# How to call manage.py
CELERYD_MULTI="multi"

# Extra command-line arguments to the worker
CELERYD_OPTS="--time-limit=300 --concurrency=8"

# - %n will be replaced with the first part of the nodename.
# - %I will be replaced with the current child process index
#   and is important when using the prefork pool to avoid race conditions.
CELERYD_PID_FILE="/var/run/balu/%n.pid"
CELERYD_LOG_FILE="/var/log/balu/%n%I.log"
CELERYD_LOG_LEVEL="INFO"

这是我的celery.service文件

[Unit]
Description=Celery Service
After=network.target

[Service]
Type=forking
User=balu
Group=balu
EnvironmentFile=/etc/conf.d/celery
WorkingDirectory=/home/.../projecttitle
ExecStart=/bin/sh -c '${CELERY_BIN} multi start ${CELERYD_NODES} \
  -A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \
  --logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}'
ExecStop=/bin/sh -c '${CELERY_BIN} multi stopwait ${CELERYD_NODES} \
  --pidfile=${CELERYD_PID_FILE}'
ExecReload=/bin/sh -c '${CELERY_BIN} multi restart ${CELERYD_NODES} \
  -A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \
  --logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}'

[Install]
WantedBy=multi-user.target

我已重新启动sudo systemctl daemon-reload,并且在尝试启动celery时 我遇到这样的错误。

celery.service的作业失败,因为控制进程退出并显示错误代码。 有关详细信息,请参见“ systemctl status celery.service”和“ journalctl -xe”。

这是错误状态的完整列表

● celery.service - Celery Service
   Loaded: loaded (/etc/systemd/system/celery.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2020-04-21 10:13:02 IST; 10s ago
  Process: 10601 ExecStart=/bin/sh -c ${CELERY_BIN} multi start ${CELERYD_NODES}    -A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE}   

Apr 21 10:13:02 balu-Inspiron-14-3467 systemd[1]: Starting Celery Service...
Apr 21 10:13:02 balu-Inspiron-14-3467 systemd[1]: celery.service: Control process exited, code=exited status=126
Apr 21 10:13:02 balu-Inspiron-14-3467 systemd[1]: celery.service: Failed with result 'exit-code'.
Apr 21 10:13:02 balu-Inspiron-14-3467 systemd[1]: Failed to start Celery Service.

任何帮助???预先感谢

0 个答案:

没有答案
相关问题