java - Using Quartz to Schedule Single Job Across Multiple Stateless App Servers -
java - Using Quartz to Schedule Single Job Across Multiple Stateless App Servers -
i have layer of identical app servers behind load balancer. operational reasons have constraint application configuration on both app servers must identical nodes can added , removed. app servers share same database. app servers not/will not clustered.
this has worked fine until now, have scheduled job executes on 1 of app servers. app servers run quartz , have same schedule running jobs. trigger fire on every app server, 1 app server execute job - race start , 1 starts, remaining app servers ignore job. thought here if lose app server, 1 run job instead, , if add together new app servers, take turn @ running jobs.
i planning having 'job lock' table in database app servers read prior starting job , start if job 'unlocked'. app server makes update first table block others updating table running state/resetting @ end of job.
before build this, i'd appreciate input more experience of quartz:
a) can hook behaviour quartz doesn't have done on per job basis? i.e. developers can add together new jobs without worrying job locking abstracted away.
b) quartz provide built in mechanisms accomplish similar above don't have roll myself?
thanks!
do think work you? http://quartz-scheduler.org/documentation/quartz-2.x/configuration/configjdbcjobstoreclustering
excerpt link
clustering works jdbc-jobstore (jobstoretx or jobstorecmt), , works having each node of cluster share same database.
load-balancing occurs automatically, each node of cluster firing jobs can. when trigger's firing time occurs, first node acquire (by placing lock on it) node fire it.`
java quartz-scheduler
Comments
Post a Comment