0

I am using Quartz scheduler with MySql as JobStore in a maven based application and I want to implement the clustering feature of Quartz but I don't have any idea how to add multiple nodes in the cluster and how Quartz knows about the nodes and manages them?

In short I want to understand How Quartz actually works and how to setup clustering environment.

Any help will be highly appreciated.

Thanks

Heena Hussain
  • 3,673
  • 1
  • 20
  • 21
  • Configuration Reference http://quartz-scheduler.org/documentation/quartz-2.1.x/configuration/ConfigJDBCJobStoreClustering. Hope this helps. – Ashish Oct 24 '13 at 04:57
  • Thanks @Ashish for your reply.I have gone through the documentation but its not clear how to setup multiple nodes. – Heena Hussain Oct 24 '13 at 06:29

1 Answers1

5

How Quartz actually works

You have to configure Quartz (quartz.properties) in all your cluster nodes. Quartz will recognize and use this config file provided it is somewhere in the classpath. The configuration file must be identical (except a few exceptions) on all the nodes, and contain:

The 2nd point is important because it connects Quartz to a database where the information about the jobs will be stored and shared in your cluster nodes. For example, every time a job is fired on a node, the information is passed to the other nodes via the database, and other nodes won't fire the same job again.

How to setup clustering environment

You need a working cluster of your App Server before. Make sure your AS (tomcat, jboss, etc) is properly configured in a cluster, then configure Quartz on each node as explained above. Details are in the link provided by Ashish.

Philippe A
  • 1,252
  • 9
  • 22
  • Thanks for your reply. Its really very helpful.As you suggested that I need a working cluster of my App server and that must be properly configured in the CLUSTER.Could you elaborate it more.I mean how I could achieve that? – Heena Hussain Oct 25 '13 at 09:50
  • That's a whole different topic that requires more than just a comment to elaborate. If your AS is JBoss, you can read https://community.jboss.org/message/821480 . If your AS is Tomcat, you can read http://tomcat.apache.org/tomcat-7.0-doc/cluster-howto.html . My answer assumes that you already have a cluster, and you just want to configure Quartz to work properly in this cluster. I don't think it's possible to have your app run in a single server, and Quartz run in a cluster. – Philippe A Oct 30 '13 at 02:20