michaelklishin / quartz-mongodb

A MongoDB-based store for the Quartz scheduler. This fork strives to be as feature complete as possible. Originally by MuleSoft.
Other
249 stars 203 forks source link

Clustering #66

Closed agherardi closed 8 years ago

agherardi commented 10 years ago

Hi, I need support for Quartz clustering - i.e., N > 1 servers, a repeating job runs exactly on one server for every repetition, possibly on a different server each time - using MongoDB as the datastore.

Are you working on adding support for clustering? Are there any technical issues that make the implementation difficult, or it's just a matter of having the time to write the code?

Thanks!

michaelklishin commented 10 years ago

We are not working on this. External contributions are welcomed. It should be roughly as easy to do on top of MongoDB as it is on top of an RDBMS, so largely copying Quartz's existing stores is a good strategy.

rliberal commented 10 years ago

Hi I want to contribute for MongoDB clustering in Quartz. Where I should start to learn this?

michaelklishin commented 10 years ago

@rliberal take a look at what clustering means in Quartz, then describe it. There isn't much documentation on the details of that. Then it will be much easier to see where to start. Also, see what the JDBC store does, it's a de facto reference implementation for durable data stores.

rliberal commented 10 years ago

Basically I need Clustered Quartz Jobs in two servers. If it is not clustered both servers executes the job twice. I need this job execution only once.

michaelklishin commented 10 years ago

@rliberal now that you know what you want to see, take a look at how JDBC store accomplishes this. I suspect it uses the database as a lock service. Distributed locking is not an easy problem, so we need to gather more info about how exactly that works.

javabrains commented 9 years ago

Hi. I also want clustering support in quartz for mongoDb. Can anyone please guide me what are the implementation logic we are missing in current one for cluster support. @agherardi @rliberal could you please let me know if you have found out solution for cluster support requirement.? @michaelklishin could you please brief me on missing feature?

bertramn commented 9 years ago

Interesting thread indeed. I did not yet have a closer look at the JDBC cluster code but I would boldly assume that it just requires the use of the atomic lock for update functionality on the trigger data-set. That can be achieved in MongoDB.

maheshbabu1907 commented 8 years ago

Is this feature still pending?

michaelklishin commented 8 years ago

Not only it is "pending", nobody has clearly laid out a design for it.

xiaolongyuan commented 8 years ago

+1

pwojnowski commented 8 years ago

Hi. I've been working on this recently (pwojnowski's fork). I had to restructure the code a bit to make any sense of it, sorry. :-)

Clustering consists of two parts: load balancing and failover. It can be enabled by setting the clustering property as in Quartz. Load balancing works. Failover should work, but I haven't tested it thoroughly yet, so if anyone would like to do some testing - feel free.

Failover is using approach of lock expiration. If scheduler instance that created a lock haven't checked-in on time it is assumed to be defunct (as in Quartz). If the scheduler is defunct and lock time has exired then the lock can be taken over by the current scheduler.

Current clustering implementation assumes that there is only one cluster per Mongo Collection. For other clusters use different collection name.

@michaelklishin If you are fine with the changes I can create a pull request.

michaelklishin commented 8 years ago

@pwojnowski thanks. It would be much easier to reason about the changes if you submit a pull request. Pull requests can be updated by pushing to the same branch ;)

pwojnowski commented 8 years ago

There are more than 70 commits, so not sure that PR will help, but will submit.