Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scheduler in clustered environment

Our (Spring) application contains several Schedulers which become active during the night to change/update some data (from Database) in Batch.

This is all running fine, the problem is that our application will soon run in a clustered environment.

What are the best options to prevent a scheduler of instance A and instance B are doing the same work at the same time?

** UPDATE **
Clustered environment is setup as 'active-active'.
Each node communicates with it's own database instance. Each database instance will replicate data to the other instances.
DB-instances are not setup as 'master-slave' but will run in a Galera cluster where each instance executes insert-update-delete operations.

So each scheduler should run only once on one instance. The other instances should not run the schedulers. So I need to find a way the a Scheduler of one instance runs, the same schedulers of the other instances should not run.

like image 829
user2054927 Avatar asked Jul 07 '16 13:07

user2054927


People also ask

How do I manage clustered scheduled tasks in Task Scheduler?

While clustered scheduled tasks can only be managed through PowerShell, they also show up in the Task Scheduler user interface under the Failover Clustering folder. Can I use any account other than the SYSTEM account?

How to disable/enable the scheduler on a node in cluster setup?

To add the server-level property to disable/enable the scheduler on a node in cluster setup: Log in to the WebLogic Administrative Console. In left pane, click Environment, Servers. Click the name of the managed server in which you want to add the scheduler.disabled=true property. Click Configuration, Server start tab in the right pane.

How does synchronization work in a clustered environment?

In a clustered environment, there is no synchronization. Each Integration Server has a scheduler thread, and whichever server gets to it first will run a task. There is no intention to make a task stick to one node, nor does it make any attempt to evenly distribute the load.

What are the different statuses of the scheduler?

At any given instance, the scheduler can be in one of the following statuses: If the scheduler is in the started status, then jobs can be scheduled and jobs that have already been scheduled will continue to run at the scheduled time. If the scheduler is in the stopped status, then all jobs are stopped.


1 Answers

Just for completeness: we ended up with persistent Quartz job scheduling.
This post helped me a lot about persistent Quartz scheduling with Spring.

like image 179
user2054927 Avatar answered Oct 13 '22 01:10

user2054927