/etc/init.d/celeryd在AWS上启动失败

时间:2015-05-15 06:21:21

标签: django amazon-web-services celery celeryd djcelery

您好,我在这个论坛上已经阅读了很多关于此事的内容,但我现在还不知道现在出了什么问题,看起来一切正常,但是只是不工作

我设置了这样的本地配置(/ etc / default / celeryd):

[phonegap] 200 /home.html
[phonegap] 200 /img/logo.png
[phonegap] 200 /__api__/autoreload

当我运行/etc/init.d/celeryd start时,我得到了这个:

# or we could have three nodes:
#CELERYD_NODES="w1 w2 w3"

# Absolute or relative path to the 'celery' command:
#CELERY_BIN="/usr/local/bin/celery"
CELERY_BIN="/home/ubuntu/.virtualenvs/wlenv/bin/celery"

# Where to chdir at start.
CELERYD_CHDIR="/var/www/DIR_TO_MANAGE.PY_FOLDER"

# Python interpreter from environment.
ENV_PYTHON="/home/ubuntu/.virtualenvs/wlenv/bin/python"
#ENV_PYTHON="/usr/bin/python2.7"

# Name of the projects settings module.
export DJANGO_SETTINGS_MODULE="sec.settings"

# How to call "manage.py celeryd_multi"
CELERYD_MULTI="$CELERYD_CHDIR/manage.py celeryd_multi"

# Extra arguments to celeryd
CELERYD_OPTS="--time-limit 300 --concurrency=8"

# Name of the celery config module.
CELERY_CONFIG_MODULE="celeryconfig"

# %n will be replaced with the nodename.
CELERYD_LOG_FILE="/logs/celery/log/%n.log"
CELERYD_PID_FILE="/logs/celery/run/%n.pid"

# Workers should run as an unprivileged user.
CELERYD_USER="ubuntu"
CELERYD_GROUP="ubuntu"

# If enabled pid and log directories will be created if missing,
# and owned by the userid/group configured.
CELERY_CREATE_DIRS=1

但是工作人员没有运行(/etc/init.d/celeryd status):

celeryd-multi v3.0.9 (Chiastic Slide)
> Starting nodes...
    > celery.ip-10-51-179-42: OK
    > 300.ip-10-51-179-42: OK

我读了一些关于这样的运行(sh -x /etc/init.d/celeryd start)并找到错误,大部分时间都是文件权限错误,但我没有看到任何错误

Error: No nodes replied within time constraint.

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

您使用的是哪种芹菜? 你调试时使用了“C_FAKEFORK = 1 sh -x /etc/init.d/celeryd start”(C_FAKEFORK = 1)吗?

如果您使用的是版本3.x +,则不需要使用“manage.py celery”(djangp-celery),而是必须使用芹菜本身附带的“celery”命令。 查看this part of the doc文档。 谢谢!