阅读背景:

spring quartz2.2.3 集群

来源:互联网 
#配置参数详解,查看https://haiziwoainixx.iteye.com/blog/1838055
#============================================================================
# Configure Main Scheduler Properties  
#============================================================================
# 可为任何值,用在jdbc jobstrore中来唯一标识实例,但是在所有集群中必须相同
org.quartz.scheduler.instanceName: MyClusteredScheduler
#AUTO即可,基于主机名和时间戳来产生实例ID
#集群中的每一个实例都必须有一个唯一的"instance id",应该有相同的"scheduler instance name"
org.quartz.scheduler.instanceId: AUTO
#禁用quartz软件更新
org.quartz.scheduler.skipUpdateCheck: true

#============================================================================
# Configure ThreadPool  执行任务线程池配置
#============================================================================
#线程池类型,执行任务的线程
org.quartz.threadPool.class: org.quartz.simpl.SimpleThreadPool
#线程数量
org.quartz.threadPool.threadCount: 10
#线程优先级
org.quartz.threadPool.threadPriority: 5
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true 

#============================================================================
# Configure JobStore  任务存储方式
#============================================================================

org.quartz.jobStore.misfireThreshold: 60000
#可以设置两种属性,存储在内存的RAMJobStore和存储在数据库的JobStoreSupport
#(包括JobStoreTX和JobStoreCMT两种实现JobStoreCMT是依赖于容器来进行事务的管理,而JobStoreTX是自己管理事务)
#这里的属性为 JobStoreTX,将任务持久化到数据中。
#因为集群中节点依赖于数据库来传播 Scheduler 实例的状态,你只能在使用 JDBC JobStore 时应用Quartz 集群。    
#这意味着你必须使用 JobStoreTX 或是 JobStoreCMT 作为 Job 存储;你不能在集群中使用 RAMJobStore。
org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX

#JobStoreSupport 使用一个驱动代理来操作 trigger 和 job 的数据存储
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
#若要设置为true,则将JobDataMaps中的值当作string
org.quartz.jobStore.useProperties=false
#对应下方的数据源配置,与spring结合不需要这个配置
#org.quartz.jobStore.dataSource=myDS
#org.quartz.jobStore.tablePrefix=QRTZ_

#你就告诉了Scheduler实例要它参与到一个集群当中。这一属性会贯穿于调度框架的始终,用于修改集群环境中操作的默认行为。
org.quartz.jobStore.isClustered=true
#属性定义了Scheduler实例检入到数据库中的频率(单位:毫秒)。默认值是 15000 (即15 秒)。
org.quartz.jobStore.clusterCheckinInterval = 20000

#这是 JobStore 能处理的错过触发的 Trigger 的最大数量。
#处理太多(超过两打) 很快会导致数据库表被锁定够长的时间,这样就妨碍了触发别的(还未错过触发) trigger 执行的性能。
org.quartz.jobStore.maxMisfiresToHandleAtATime = 1
org.quartz.jobStore.misfireThreshold = 120000
org.quartz.jobStore.txIsolationLevelSerializable = false


#============================================================================
# Configure Plugins 
#============================================================================
#当事件的JVM终止后,在调度器上也将此事件终止
#the shutdown-hook plugin catches the event of the JVM terminating, and calls shutdown on the scheduler.
org.quartz.plugin.shutdownHook.class: org.quartz.plugins.management.ShutdownHookPlugin
org.quartz.plugin.shutdownHook.cleanShutdown: true

#记录trigger历史的日志插件
#org.quartz.plugin.triggHistory.class: org.quartz.plugins.history.LoggingJobHistoryPlugin#配置参数详解,查看https://haiziwoainixx.iteye.com/blog/



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: