How to run celery as a daemon in production?

后端 未结 5 1065
再見小時候
再見小時候 2020-12-13 02:58

i created a celeryd file in /etc/defaults/ from the code here:

https://github.com/celery/celery/blob/3.0/extra/generic-init.d/celeryd

Now when I want to run

5条回答
  •  醉话见心
    2020-12-13 03:31

    As Marcin has explained in his answer that supervisor is usually what people end up using but if you are looking for something which could work with python3 and can't wait for supervisor's version 4 which I think will have the support for python3 then you can go with circus. After installing it, you just need to have a circus.ini file which will have all the processes which you want to daemonize and then run that sample circus.ini may look like:

    [watcher:celery]
    cmd = full_path/python3.4 full_path/manage.py celeryd -B -l info
    
    [watcher:celerycamera]
    cmd = full_path/python3.4 full_path/manage.py celery events --camera=djcelery.snapshot.Camera
    
    [watcher:dceleryflower]
    cmd = full_path/python3.4 full_path/manage.py celery flower -A your_app_name --basic_auth=username:password --port=5555 
    

    if you want some more details I have a post related to the same here. Hope it saves someone some time. Thanks

提交回复
热议问题