Reputation: 438
I have a cluster with two nodes, which is connected to the same database, and a scheduled job, which is initiated by Quartz scheduler in every 10th minutes. In quartz.properties org.quartz.jobStore.isClustered=true
is set.
I'm interested in whether the scheduler will issue the job for the same node until it is reachable in every 10th minute, or it uses some kind of algorithm to determine that which node will do the job.
I didn't find anything about it in the documentation (http://www.quartz-scheduler.org/documentation/quartz-2.x/configuration/ConfigJDBCJobStoreClustering.html).
Thank You.
Upvotes: 2
Views: 1769
Reputation: 46
I found this in the quartz tutorials:
Only one node will fire the job for each firing. What I mean by that is, if the job has a repeating trigger that tells it to fire every 10 seconds, then at 12:00:00 exactly one node will run the job, and at 12:00:10 exactly one node will run the job, etc. It won’t necessarily be the same node each time - it will more or less be random which node runs it. The load balancing mechanism is near-random for busy schedulers (lots of triggers) but favors the same node that just was just active for non-busy (e.g. one or two triggers) schedulers.
http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/tutorial-lesson-11.html
Upvotes: 3