I am running a Django application that runs asynchronous tasks using Celery and using a Redis server as a worker.
I need to be able to stop the entire infrastructure and bring it back up without causing a break in the execution of tasks. So I need to do this:
1) Stop the Django webservice
2) Stop celery
3) Shut down Redis daemon
4) Make a few changes in the server or move to a different machine
5) Start Redis daemon
6) Start Celery
7) Start the Django webservice
When the entire infrastructure is back up again it should continue where it left off. i.e. if there were any tasks in the queue it should continue executing them.
How do I go about doing this? Is there a way to save the queue and continue later?
Is there a way to save the queue and continue later?
Yes. All your tasks are saved in Redis. If you can keep it running, or export/import its data you won't lose any tasks.
So broadly 2 options.
Option 1:
More on RDB: https://redis.io/topics/persistence
Option 2:
All the while keeping redis running.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With