Quartz scheduler in cluster environment

前端 未结 1 1578
旧时难觅i
旧时难觅i 2020-12-07 16:11

I am using

SchedulerFactory schedulerFactory = new StdSchedulerFactory();
scheduler = schedulerFactory.getScheduler();
scheduler.start();
Trigger asapTrigge         


        
相关标签:
1条回答
  • 2020-12-07 16:38

    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.

    0 讨论(0)
提交回复
热议问题