Preserve beanstalkd queue on restart or crash
Asked Answered
A

1

5

I'm using beanstalkd to managed queues. I just realised that if there are jobs in a queue and the beanstalkd process is restarted or crashes then the job is lost forever (or so I think).

Is there a way to preserve the jobs in the queue on beanstalkd failure or restart? If not, whats best practice to ensure jobs are never lost?

Atchison answered 27/5, 2015 at 17:54 Comment(0)
T
16

Beanstalkd can be started with the -b (binary log) option, and beanstalkd will write all jobs to a binlog. If the power goes out, you can restart beanstalkd with the same option and it will recover the contents of the log.

Tung answered 27/5, 2015 at 20:44 Comment(2)
How does one add the -b option when beanstalkd is started as a service?Dorseydorsiferous
Just add it to your /etc/default/beanstalkd like so: DAEMON_OPTS="(your current options) -b /var/lib/beanstalkd"Kirovograd

© 2022 - 2024 — McMap. All rights reserved.