Aug 19th, 2012, 01:17 PM
Clustered cron jobs
I am using spring TaskExecutor and TaskScheduler .
I need high availability so i have a cluster from my web cron job project.
But each node in the cluster fire the cron job.
How can i do to only one node in the cluster fire the job ?
Sep 6th, 2012, 03:23 AM
Use Quartz with a database store - it is indended to use in a cluster environment. Spring has support for Quartz.
I think Spring build-in task api (task namespace etc.) does not have support for clusters. You can run scheduled tasks on one node only, but the node can go down and you lost high availability.
Sep 6th, 2012, 09:05 AM
Originally Posted by libor.subcik
Thank you very much for the advice.
I'm reading about Quartz. Quartz supports clustered Quartz cron jobs (http://quartz-scheduler.org/document...toreClustering).
However, quartz has "issues" if i deploy my project on different machines.
"Never run clustering on separate machines, clocks are synchronized Their UNLESS using some form of time-sync service (daemon) runs very Regularly That (the clocks must be Within a second of each other)."
The project requeire H.A. therefore it will be deployed in different county datacenters, so it is not possible to synchronize the clocks of the machines.
I'm still researching to see if I can give a solution.
Thank you very much.
Sep 10th, 2012, 09:10 AM
Originally Posted by Lewisser
Could you solve the problem quartz in different machines?
Can you help with this probem.
Thanks for your attention.