1

I have this my project folder structure

api
    -- __init__.py
    --jobs/
        -- __init__.py
        -- celery.py
        -- celeyconfig.py
        -- tasks.py
    --api_helpers/
    --views/

tasks has a task called ExamineColumns

I launch the worker using celery worker -A api.jobs --loglevel=Info

It works fine and I can run the tasks.

This is the ourput of celery examine command

$ celery inspect registered
-> ranjith-ThinkPad-T420: OK
    * ExamineColumns
    * celery.backend_cleanup
    * celery.chain
    * celery.chord
    * celery.chord_unlock
    * celery.chunks
    * celery.group
    * celery.map
    * celery.starmap

But when I try the multi mode it simply does not work. I am trying to run by running

celery multi start w1 -c3 -A api.jobs  --loglevel=Info

But it does not start at all.

$ celery inspect registered
Error: No nodes replied within time constraint.

I am not sure why it is not working

Ranjith Ramachandra
  • 10,399
  • 14
  • 59
  • 96

1 Answers1

3

You can try to run as:

/usr/bin/celery multi start w1 w2 --uid=www --loglevel=INFO --pidfile=/var/run/%n.pid --logfile=/var/log/%n.log --quiet

--uid must be user/group from your server. Not recommended use root

--quiet will not output data to console

%n.log will replace itself on w1.log and w2.log


For checking you can use ps uax | grep celery Result will be as so:

www ... /usr/local/bin/python2.7 -m celery.bin.celeryd -n w1.domain.ru --loglevel=DEBUG --logfile=/var/log/w1.log --pidfile=/var/run/w1.pid
www ... /usr/local/bin/python2.7 -m celery.bin.celeryd -n w2.domain.ru --loglevel=DEBUG --logfile=/var/log/w2.log --pidfile=/var/run/w2.pid
Abbasov Alexander
  • 1,848
  • 1
  • 18
  • 27
  • How do I give the --app argument. Just append to the command? – Ranjith Ramachandra Jul 08 '13 at 06:58
  • It seems I not knew about `--app argument` But if you want to run celery for your project you must it run from folder that included config file of celery. The config of celery should have option `CELERY_IMPORTS=("path_to_app.tasks",)` See http://docs.celeryproject.org/en/latest/configuration.html?highlight=celery_imports#celery-imports – Abbasov Alexander Jul 08 '13 at 11:25
  • Is it possible to run the multi start command not as a daemon? – tzenderman Oct 22 '13 at 05:10
  • @tzenderman Yes, but It seems I don't understood you. Please, give me more details your's task. – Abbasov Alexander Oct 26 '13 at 12:38
  • @AbbasovAlexander So, I run celery using supervisord. I wasn't able to find a way to run `celery multi start` without daemonizing the process. For it to be able to work correctly with supervisord, the process cannot be run as a daemon. – tzenderman Oct 28 '13 at 12:17