Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
528 views
in Technique[技术] by (71.8m points)

maven - How to configure clustering with more than one node in Quartz scheduler?

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...