尝试运行celeryd_multi时出现属性错误

时间:2012-09-21 18:29:24

标签: python django celery django-celery

尝试启动celeryd_multi时,我手动(AttributeError: 'module' object has no attribute 'getrlimit')或通过init.d作为守护进程获得python manage.py celeryd_multi...

  • 我可以使用python manage.py celeryd
  • 手动启动芹菜
  • CELERYD_MULTI从/ etc / default / celeryd中移除会导致此错误:usr/bin/python: No module named celery.__main__; 'celery' is a package and cannot be directly executed
  • 手动启动celeryd_multi也会导致'getrlimit'属性错误

这是我的/ etc / default / celeryd文件的样子:

CELERYD_NODES="w1"
CELERYD_CHDIR="/code/project"

CELERYD_MULTI="python $CELERYD_CHDIR/manage.py celeryd_multi"

CELERYCTL="$CELERYD_CHDIR/manage.py celeryctl"

CELERYD_OPTS="--time-limit=300 --concurrency=8"

CELERY_CONFIG_MODULE="celeryconfig"

CELERYD_LOG_FILE="/var/log/celery/celeryd.log"
CELERYD_PID_FILE="/var/run/celery/celeryd.pid"

CELERYD_USER="celery"
CELERYD_GROUP="celery"

export DJANGO_SETTINGS_MODULE="project.settings"

下面是堆栈跟踪:

> Starting nodes...
    > w1.ip-10-28-232-109: OK
ubuntu@ip-10-28-232-109:~$ Traceback (most recent call last):
  File "/code/project/manage.py", line 14, in 
    execute_manager(settings)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/djcelery/management/commands/celeryd_detach.py", line 26, in run_from_argv
    detached().execute_from_commandline(argv)
  File "/usr/local/lib/python2.7/dist-packages/celery/bin/celeryd_detach.py", line 146, in execute_from_commandline
    **vars(options)))
  File "/usr/local/lib/python2.7/dist-packages/celery/bin/celeryd_detach.py", line 37, in detach
    with detached(logfile, pidfile, uid, gid, umask, working_directory, fake):
  File "/usr/local/lib/python2.7/dist-packages/celery/platforms.py", line 248, in open
    for fd in reversed(range(get_fdmax(default=2048))):
  File "/usr/local/lib/python2.7/dist-packages/celery/platforms.py", line 83, in get_fdmax
    fdmax = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
AttributeError: 'module' object has no attribute 'getrlimit'

0 个答案:

没有答案