Quartz scheduler in cluster environment

You have to configure Quartz to run in a clustered environment. Clustering currently only works with the JDBC jobstore, and works by having each node of the cluster to share the same database.

  • Set the org.quartz.jobStore.isClustered property to true if you have multiple instances of Quartz that use the same set of database tables. This property is used to turn on the clustering features.
  • Set the org.quartz.jobStore.clusterCheckinInterval property (milliseconds) which is the frequency at which this instance checks in with the other instances of the cluster.
  • Set the org.quartz.scheduler.instanceId to AUTO so that each node in the cluster will have a unique instanceId.

Please note that each instance in the cluster should use the same copy of the quartz.properties file. Furthermore if you use clustering on separate machines ensure that their clocks are synchronized.

For more information check the official documentation which contains a sample properties file for a clustered scheduler.

Leave a Comment

tech