Coordinating jobs

55 views
Skip to first unread message

rakesh mailgroups

unread,
Oct 24, 2012, 4:37:06 AM10/24/12
to java...@googlegroups.com
Hi,

I have some batch jobs running and am using Quartz Schedular. They run based on a specific time schedule (eg 55 and 25 minutes each hour over 24 hours).

Thing is, I have (at a minimum) 2 nodes running the same software for disaster recovery reasons. So I need a way to only run a job by one of the nodes.

Turns out its quite tricky to get right and I keep finding bugs which are hard to reproduce!

The current implementation requires each node to write to the db first to say its going to run the job, then read back the record to see if it succeeded in the write (there's a unique key on the job name) and if so, run the job.

However, there seem to be issues with overlapping jobs (I think, hard to diagnose after the fact and they are intermittent).

I was wondering if there was an easier solution out there I could easily use?

Thanks

Rakesh

Ricky Clarkson

unread,
Oct 24, 2012, 9:04:58 AM10/24/12
to java...@googlegroups.com
Quartz has a JDBC backend that should be able to do this. Also,
there's Rundeck and Jenkins.
> --
> You received this message because you are subscribed to the Google Groups
> "Java Posse" group.
> To post to this group, send email to java...@googlegroups.com.
> To unsubscribe from this group, send email to
> javaposse+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/javaposse?hl=en.

Wesley Hartford

unread,
Oct 27, 2012, 11:59:11 AM10/27/12
to java...@googlegroups.com
I've been using quartz for years and love it. The JDBC job store can be a little tricky to get working, but it gives you just what you're looking for, and once it is set up, it is rock solid. Reply if you are having trouble setting it up and I'll post the settings I've used.

Wesley

Rakesh

unread,
Oct 28, 2012, 11:57:26 AM10/28/12
to java...@googlegroups.com
thanks guys for the recommendation to use Quartz Jdbc thingy.

Unfortunately, I am not using a relational db!! I'm using MongoDB.

Rakesh

--
You received this message because you are subscribed to the Google Groups "Java Posse" group.
To view this discussion on the web visit https://groups.google.com/d/msg/javaposse/-/ZjGaaSih0SAJ.

Phil Haigh

unread,
Oct 29, 2012, 3:53:47 AM10/29/12
to java...@googlegroups.com
I recently worked on a Grails app that ran as four nodes; one node performed job scheduling and announced itself as the 'master' via a UDP broadcast. If I remember correctly it would send a UDP periodically; when other nodes stopped receiving, another would assign itself as master, start broadcasting and run the jobs instead.

I can't remember if we rolled our own Java plugin, or used something off the shelf, I'll see if I can remember but I do know it worked very well.

Ryan Schipper

unread,
Oct 29, 2012, 4:19:38 AM10/29/12
to java...@googlegroups.com
Jgroups - http://www.jgroups.org/ ??

No affiliation. I have used it before for grouping and notifications (member leaves, member joins, etc). No significant issues.

To view this discussion on the web visit https://groups.google.com/d/msg/javaposse/-/IMcGnkXuL70J.
Reply all
Reply to author
Forward
0 new messages