Can celery work on a stretchy bean stalk?
I'm looking for a direct way to run Celery on Beanstalk Resilient. Does this exist or do I need to use SQS instead?
I tried to put the line in the .config file with no good results. This is my .config file:
container_commands:
01_syncdb:
command: "django-admin.py syncdb --noinput"
leader_only: true
02_collectstatic:
command: "./manage.py collectstatic --noinput"
03_migrate:
command: "./manage.py migrate --noinput"
04_start_celery:
command: "./manage.py celery worker &"
When I ssh to the EC2 server and run it ps -ef | grep celery
, it shows that Celery is not working.
Any help is appreciated. Thank!
source to share
Celery does not appear because container commands are executed before rebooting the web server during deployment. Basically, your celery workers are wiped off after restarting the machine.
I would suggest starting celery using deploy hooks.
See http://junkheap.net/blog/2013/05/20/elastic-beanstalk-post-deployment-scripts/ and How to start a worker with AWS Elastic Beanstalk?
source to share