I have next server configuration - three web server under load balancing work with one db. I create scheduled job, that need to start on each instance each "next scheduled date", but it starts only the one random instance. see below part of job history
10/26/2010 10:40:24 AM OK Finished. Processed 13 destinations at SERVER3 server for 2 seconds
10/26/2010 10:15:24 AM OK Finished. Processed 13 destinations at SERVER2 server for 2 seconds
10/26/2010 9:50:24 AM OK Finished. Processed 13 destinations at SERVER1 server for 1 seconds
The question is - how to prevent scheduler from check - was the task run on the other instance?
Ivan, this behaviour is by design. A sceduled job is only ever meant to run once, on any of the web servers. You can control which machine scheduled jobs run on by using the "enableScheduler" flag in web.config. If you need communicaton between machines as a result of running a sceduled job then I advise looking into the EPiServer events system:
If the job needs to run on each machine then you are better off looking at a Windows Service.
Simply put: you dont.The scheduler is written in such a way that the job will be executed on *one* of the connected servers. You *could* modify the stored procedures to circumvent this behaviour but its really not recommended...
A workaround could be to make use of EPiServers remote event functionality and have the code execute whenever a specific event is raised, and then have the server that happens to check out the scheduled job simply raise the event.
More on events here:http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-5/EPiServer-CMS-SP2/Event-Management-System-Specification/
Congrats David, you beat me with 8secs :-)
No worries Johan - I'm simply glad I got the answer correct :)!