1

I have quartz configured to work in cluster here my simple quartz config

org.quartz.scheduler.instanceName=jobs-scheduler

org.quartz.scheduler.instanceId=AUTO
org.quartz.threadPool.threadCount=5
org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.useProperties=true
org.quartz.jobStore.misfireThreshold=10000
org.quartz.jobStore.tablePrefix=QRTZ_

org.quartz.jobStore.isClustered=true
org.quartz.jobStore.clusterCheckinInterval=20000

I have two nodes executing my jobs however when I schedule some task to run every second I can see it's being executed only on node1. If I pause scheduler on node1 task will move to node2 and sticks to it even when node1 came online again. How can I possibly make executions evenly deviated between the nodes?

Thanks

Evgeny Makarov
  • 1,417
  • 1
  • 21
  • 41

1 Answers1

0

This might be helpful. If your cluster isn't terribly busy, one node may end up doing all of the work, because each time it completes a job, it'll go and look for more work, and find the next run of the job it just completed. The other node on your cluster will poll for work periodically, but be less likely to find anything that needs doing.

Do you have a reason to want to distribute work more evenly across your cluster? Is something not getting done? If a node is accepting more work than its capable of completing, you might consider turning the threadCount down.

Andrew Rueckert
  • 4,858
  • 1
  • 33
  • 44
  • Thanks for the answer. This is just came up when I wrote tests for the cluster. There is no real issue here – Evgeny Makarov May 13 '17 at 18:34
  • We have an issue when a job scheduled by an app in a newly deployed container is executed by the same app running in an existing container. The job is meant to run in the new container to update its state, but the existing container will (sometimes) run the job and then exit, leaving the new container in an "incomplete" state. Pinning a job to the instance that scheduled it is what we need. – Jack Straw Jan 18 '23 at 04:14