Spring Scheduler in Clustered environment
<p>I am using spring scheduler using @Scheduled annotation to schedule a job that runs a file generation service. The application is deployed on 5 separate nodes of tomcat in clustered environment for load balancing and fail over.  Because of this, service is scheduled 5 times which is never expected.
Is there a way to configure the scheduler to be run only on the current node?</p>

<p>There is an approach that uses database to figure out the current alive node and invoking the scheduler for that particular instance <a href="https://stackoverflow.com/a/35226261/2751833">here</a></p>

<p>Another approach is to use <a href="http://www.quartz-scheduler.org/documentation/quartz-2.x/configuration/ConfigJDBCJobStoreClustering" rel="noreferrer">quartz scheduler</a></p>

<p>Since I could not make major changes to the deployed application, is there a simple solution to the issue? Please advise. </p>