django /芹菜 - 芹菜状态:错误:没有节点在时间限制内回复 [英] django/celery - celery status: Error: No nodes replied within time constraint

查看:1799
本文介绍了django /芹菜 - 芹菜状态:错误:没有节点在时间限制内回复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的生产服务器中部署一个简单的芹菜样本,我已经在芹菜网站上关于运行芹菜作为守护进程的教程 http://docs.celeryproject.org/en/latest/tutorials/daemonizing.html#daemonizing ,我得到了配置文件在 / etc / default / celeryd

 
1#要启动的节点名称
2#这里我们有一个单节点
3 CELERYD_NODES =w1
4#或者我们可以有三个节点:$ b​​ $ b 5#CELERYD_NODES =w1 w2 w3
6
7#在哪里chdir开始。
8 CELERYD_CHDIR =/ home / audiwime / cidec_sw
9
10#环境中的Python解释器。
11 ENV_PYTHON =/ usr / bin / python26
12
13#如何调用manage.py celeryd_multi
14 CELERYD_MULTI =$ ENV_PYTHON $ CELERYD_CHDIR / manage。 py celeryd_multi
15
16##如何调用manage.py celeryctl
17 CELERYCTL =$ ENV_PYTHON $ CELERYD_CHDIR / manage.py celeryctl
18
19#celeryd的额外参数
20 CELERYD_OPTS = - time-limit = 300 --concurrency = 8
21
22#芹菜配置模块的名称。
23 CELERY_CONFIG_MODULE =celeryconfig
24
25#%n将被替换为nodename。
26 CELERYD_LOG_FILE =/ var / log / celery /%n.log
27 CELERYD_PID_FILE =/ var / run / celery /%n.pid
28
29 #工作人员应以无特权身份运行。
30 CELERYD_USER =audiwime
31 CELERYD_GROUP =audiwime
32
33 export DJANGO_SETTINGS_MODULE =cidec_sw.settings

但如果我运行

芹菜状态

在终端中,我得到这个响应:

错误:没有节点在时间限制内回复

我可以通过 https://中提供的celeryd脚本重新启动芹菜github.com/celery/celery/tree/3.0/extra/generic-init.d/

 
/ etc / init .d / celeryd restart
celeryd-multi v3.0.12(Chiastic Slide)
> w1.one.cloudwime.com:DOWN
>重新启动节点w1.one.cloudwime.com:OK

我可以运行

 python26 manage.py celeryd -l info 

我在django中的任务运行正常,但如果我让守护进程完成工作,我不会得到任何结果,甚至在 /var/log/celery/w1.log



我知道我的任务已经注册,因为我这样做

 code> from celery import current_app 
def call_celery_delay(request):
print current_app.tasks
run.delay(request.GET ['age'])
return HttpResponse (content =celery task set,content_type =text / html)

字典,我的任务出现

  {'celery.chain':< @task:celery.chain>,'芹菜。 chunks':< @task:celery.chunks>'celery.chord':< @task:celery.chord>,'tasks.add2':< @task:tasks.add2>,'celery.chord_unlock' :< @task:celery.chord_unlock> **'tareas.tasks.run':< @task:tareas.tasks.run> **,'tareas.tasks.add':< @task:tareas。 tasks.add>'tareas.tasks.test_two_minute':< @task:tareas.tasks.test_two_minute>'celery.backend_cleanup':< @task:celery.backend_cleanup>'celery.map':< @任务: celery.group:< @task:celery.group>'tareas.tasks.test_one_minute':< @task:tareas.tasks.test_one_minute>'celery.starmap':< @任务:celery.starmap>} 

但除此之外,我没有任何其他东西,没有任何结果,没有错误的日志,没有。
任何人都可以告诉我什么可以是错的?
你是我唯一的希望...

解决方案

我解决了我的问题,这是一个非常简单的解决方案,这也是一个奇怪的事情:
我所做的是:

  $ /etc/init.d/celerybeat restart 
$ /etc/init.d/celeryd restart
$ service celeryd restart

我不得不按照这样的顺序执行,其他方式我会得到一个丑陋的错误:没有节点在时间限制内回复。


I'm trying to deploy a simple example of celery in my production server, I've followed the tutorial in the celery website about running celery as daemon http://docs.celeryproject.org/en/latest/tutorials/daemonizing.html#daemonizing, and I got the config file in /etc/default/celeryd

  1 # Name of nodes to start
  2 # here we have a single node
  3 CELERYD_NODES="w1"
  4 # or we could have three nodes:
  5 #CELERYD_NODES="w1 w2 w3"
  6 
  7 # Where to chdir at start.
  8 CELERYD_CHDIR="/home/audiwime/cidec_sw"
  9 
 10 # Python interpreter from environment.
 11 ENV_PYTHON="/usr/bin/python26"
 12 
 13 # How to call "manage.py celeryd_multi"
 14 CELERYD_MULTI="$ENV_PYTHON $CELERYD_CHDIR/manage.py celeryd_multi"
 15 
 16 # # How to call "manage.py celeryctl"
 17 CELERYCTL="$ENV_PYTHON $CELERYD_CHDIR/manage.py celeryctl"
 18 
 19 # Extra arguments to celeryd
 20 CELERYD_OPTS="--time-limit=300 --concurrency=8"
 21 
 22 # Name of the celery config module.
 23 CELERY_CONFIG_MODULE="celeryconfig"
 24 
 25 # %n will be replaced with the nodename.
 26 CELERYD_LOG_FILE="/var/log/celery/%n.log"
 27 CELERYD_PID_FILE="/var/run/celery/%n.pid"
 28 
 29 # Workers should run as an unprivileged user.
 30 CELERYD_USER="audiwime"
 31 CELERYD_GROUP="audiwime"
 32 
 33 export DJANGO_SETTINGS_MODULE="cidec_sw.settings"

but if I run

celery status

in the terminal, i got this response:

Error: No nodes replied within time constraint

I can restart celery via the celeryd script provided in https://github.com/celery/celery/tree/3.0/extra/generic-init.d/

/etc/init.d/celeryd restart
celeryd-multi v3.0.12 (Chiastic Slide)
> w1.one.cloudwime.com: DOWN
> Restarting node w1.one.cloudwime.com: OK

I can run

python26 manage.py celeryd -l info

and my tasks in django run fine, but if I let the daemon do its work i dont get any results, don't even errors in /var/log/celery/w1.log

I know that my task has been registered because I did this

from celery import current_app
def call_celery_delay(request):
    print current_app.tasks
    run.delay(request.GET['age'])
    return HttpResponse(content="celery task set",content_type="text/html")

and I get a dictionary in wich my task appear

{'celery.chain': <@task: celery.chain>, 'celery.chunks': <@task: celery.chunks>, 'celery.chord': <@task: celery.chord>, 'tasks.add2': <@task: tasks.add2>, 'celery.chord_unlock': <@task: celery.chord_unlock>, **'tareas.tasks.run': <@task: tareas.tasks.run>**, 'tareas.tasks.add': <@task: tareas.tasks.add>, 'tareas.tasks.test_two_minute': <@task: tareas.tasks.test_two_minute>, 'celery.backend_cleanup': <@task: celery.backend_cleanup>, 'celery.map': <@task: celery.map>, 'celery.group': <@task: celery.group>, 'tareas.tasks.test_one_minute': <@task: tareas.tasks.test_one_minute>, 'celery.starmap': <@task: celery.starmap>}

but besides that I get nothing else, no result from my task, no error in the logs, nothing. Can anyone tell me what can be wrong? You are my only hope...

解决方案

I solved my problem, it was a very simple solution, but it was also a weird one: What I did was:

$ /etc/init.d/celerybeat restart
$ /etc/init.d/celeryd restart
$ service celeryd restart

I had to do this in that order, other way I'd get an ugly Error: No nodes replied within time constraint.

这篇关于django /芹菜 - 芹菜状态:错误:没有节点在时间限制内回复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆