title: clustered quartz instances schedule duplicate jobs?
body: <p>I have a Tomcat web application A that schedules jobs with quartz framework. It was running as one instance on RAM Jobstore. Recently we plan to move to JDBC Jobstore and set up a cluster, so that if one instance fails, the other instance will be able to run the job.</p>
  
  <p>Here is my issues:</p>
  
  <p>My we application A will scan a business related database table and schedule quartz jobs during starting up and every 10 minutes afterwards. If I deploy two A applications on two different tomcat instances, then there will be two sets of duplicate jobs scheduled through Quartz. </p>
  
  <p>How should I solve this problem? Do I need to extract the part of code that schedules jobs into a separate application and make sure only 1 instance is deployed so only 1 sets of jobs are scheduled? But then the problem becomes - what if this instance fails? How do I achieve fail over in this case?</p>