如果我使用 JdbcStore 将作业代码部署在两个 JVM 上,@DisallowConcurrentExecution
能否确保所有 JVM 上仅运行一个作业?
最佳答案
是的,会的;这种属性甚至适用于多个实例。这里唯一重要的是,这个属性是基于 JobKey 的,而不是 here 中描述的代码。 .
无论如何,提醒一下,不要在多个服务器上运行 Quartz,除非你有一个守护进程来保持时钟同步。来自 quartz 指南:
Never run clustering on separate machines, unless their clocks are synchronized using some form of time-sync service (daemon) that runs very regularly (the clocks must be within a second of each other). See http://www.boulder.nist.gov/timefreq/service/its.htm if you are unfamiliar with how to do this.
关于java - Quartz 的 @DisallowConcurrentExecution 是否可以跨多个 JVM 工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36136122/