title: Scheduler in clustered environment
body: <p>Our (Spring) application contains several <code>Schedulers</code> which become active during the night to change/update some data (from <code>Database</code>) in <code>Batch</code>.</p>
  
  <p>This is all running fine, the problem is that our application will soon run in a <code>clustered environment</code>.</p>
  
  <p>What are the best options to prevent a <code>scheduler</code> of <code>instance A</code> and <code>instance B</code> are doing the same work at the same time?</p>
  
  <p>** <strong>UPDATE</strong> **
  <br>
  Clustered environment is setup as <code>'active-active'</code>. <br>
  Each node communicates with it's own database instance. Each database instance will <code>replicate</code> data to the other instances. <br>
  DB-instances are not setup as <code>'master-slave'</code> but will run in a <code>Galera cluster</code> where each instance executes insert-update-delete operations. </p>
  
  <p>So each <code>scheduler</code> 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.</p>