2012-11-27 3 views
8

셀러리에 대한 간단한 예제를 프로덕션 서버에 배포하려고합니다. 샐러리를 데몬 http://docs.celeryproject.org/en/latest/tutorials/daemonizing.html#daemonizing으로 실행하는 방법에 대한 셀리 웹 사이트의 자습서를 따라했습니다. , 및 I/celeryddjango/celery - celery - 셀러리 상태 : 오류 : 시간 제약 조건에서 노드가 응답하지 않았습니다.

 
    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" 

은/etc/기본의 설정 파일을 가지고 있지만 터미널에

celery status

을 실행하면, 나는이 응답 가지고 :

Error: No nodes replied within time constraint
은 내가 장고에 내 작업이 잘 실행

python26 manage.py celeryd -l info

를 실행할 수 있습니다 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 

에서 제공하는 celeryd 스크립트를 통해 셀러리를

다시 시작할 수 있습니다 ,하지만 난 할 경우 디먼은 일을 어떤 결과도 얻지 못한다. 심지어 오류도 없다. /var/log/celery/w1.log

나는 그것을 안다. 나의 작업은 내가이

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>, '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>} 

을 표시하지만, 그 외에 내 작업, 아니 오류에서, 아무도 결과를 아무것도 얻지되지 않은 로그, 아무것도. 누가 잘못 될 수 있는지 말해 줄 수 있습니까? 당신은 나의 유일한 희망 ... 나는 내 문제를 해결

답변

-1

, 그것은 매우 간단한 해결책이었다, 그러나 그것은 또한 이상한 일이었다 : 내가 무슨 짓을 했다 :

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

내가해야 할 일을했을 그 순서대로, 나는 못생긴 에러를 얻는 다른 방법 : 아무 노드도 시간 제한 내에서 응답하지 않았다.

+0

나는'celerybeat'와'celeryd' 둘 다 필요하다고 생각하지 않습니다. 'celeryd -B'도 실행할 수 있습니다. 나는 아직도 당신이'service celeryd'를 어떻게 얻었는지에 대해 꽤 궁금해한다. (P.S.나는 여전히이 오류가 발생한다) – Houman

+1

@kave이 오류는 주로 모든 파일 권한이 올바르지 않을 때 발생한다. –

+0

@AkashDeshpande 응답 해 주셔서 감사합니다. 제발 그렇게 친절 하고이 붙여 넣기 좀 봐 : http://pastebin.com/e3GK4eax 이것은 권한을 설정하는 방법입니다, 당신은 순서가 명백한 아무것도 볼 수 있습니까? – Houman

1

문제 찾으려면 다음 명령을 사용하여 소스 프로젝트의 문제 (권한 문제, 구문 오류 등)가 있기 때문에 이것은 보통 일이

C_FAKEFORK=1 sh -x /etc/init.d/celeryd start 

을 셀러리 문서에서 언급 한 바와 같이

: -

If the worker starts with “OK” but exits almost immediately afterwards and there is nothing in the log file, then there is probably an error but as the daemons standard outputs are already closed you’ll not be able to see them anywhere. For this situation you can use the C_FAKEFORK environment variable to skip the daemonization step

행운

소스 : Celery Docs

0

셀러리 데몬이 시작되지 않았기 때문입니다. 이것이 하나의 이유입니다. 그래서 친절하게 다시 파이썬을 사용하여 그것을 다시 시작하십시오 manage.py celeryd --loglevel = INFO

관련 문제