简体   繁体   English

设置Quartz设置的'clustered'属性可以在一台机器上引起问题吗?

[英]Can setting the 'clustered' property of a Quartz setup cause problems on a single machine?

We have a bunch of quartz jobs configured for running in a clustered environment and everything seems to work fine on the real cluster (two WAS machines). 我们配置了一堆用于在集群环境中运行的石英作业,并且在实际集群(两台WAS机器)上,一切似乎都可以正常工作。

In the DEV environment we still used 在DEV环境中,我们仍然使用

org.quartz.jobStore.isClustered = true

although we only use a single machine. 尽管我们只使用一台机器。 But we get often but not always the following exception: 但是我们经常但并非总是遇到以下异常:

org.quartz.JobPersistenceException: 
    Couldn't store trigger 'DEFAULT.MT_6uclr3emepk6p' for '<group>.<name>' 
    job:The job (<group>.<name>) referenced by the trigger does not exist.

We changed the setup for the DEV environment to 我们将DEV环境的设置更改为

org.quartz.jobStore.isClustered = false

This seemed to make the problem go away. 这似乎使问题消失了。

So the questions are: 所以问题是:

  • Is it a problem to set org.quartz.jobStore.isClustered = true when you aren't actually using a cluster 当您实际上不使用集群时,将org.quartz.jobStore.isClustered = true设置为一个问题吗?
  • if so why? 如果可以,为什么?
  • if not what might be the reason for the original problem? 如果不是,那么最初问题的原因可能是什么?

UPDATE: Clarification on when the error occurs: 更新:澄清何时发生错误:

This is the snippet that sets up the job. 这是设置作业的代码段。

JobKey JOBKEY = new JobKey("Name", "group");
newTrigger().withIdentity("TriggerName", "group").forJob(
                JOBKEY).build();
JobDetail job = newJob(NameJob.class).withIdentity(
                JOBKEY)
                .storeDurably().build();
scheduler.addJob(job, false);

This snippet is supposed to trigger a job execution 该代码段应该触发作业执行

scheduler.triggerJob(JOBKEY);

That's a red herring. 那是一条红鲱鱼。 isClustered=true with one node is just fine (though unnecessary). 一个节点的isClustered = true很好(尽管不必要)。

I'll bet you were running into problems caused by multiple developers using the same database, while doing their tests/builds concurrently. 我敢打赌,您在同时进行测试/构建时遇到了多个使用同一数据库的开发人员引起的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM