How do scheduled agents work on Cluster Servers

I have my application running on Domino servers on AIX which are in cluster mode. How willl failover for these agents happen. What changes i have to make in my applications.

Subject: How do scheduled agents work on Cluster Servers

Scheduled agents run on the server they are set to run on, or ‘any server’.

If you set an agent to run on serverA… and serverA is down… it won’t run.

If you set an agent to run on ‘any server’, then the agent can be smart and look to see if it is on serverA, if so it runs… if not, then it looks to see if serverA is up… if it is, then it exits… otherwise it runs the agent!

You can add logic like this to make sure your high priority agents run even if you have a cluster farm… you only need to define the priority at the start of the agent.

Here is some sample code to illustrate this kind of thing:

'error handling

On Error Goto errorTrap ’ unexpected error - included herein to remind programmer to handle appropriately

On Error 4063 goto serverdown ’ server is down, continue code execution at ‘serverdown’

'temporary variables

Dim servercheck As String 'serverhere checking

Dim pathfilename As String 'default database to look for soe know the server is up

Dim thisserver As String

Dim i as Integer 'ubound of serverPriority array

Dim x as Integer

'server list

Dim serverPriority(3) as String 'list of servers sorted by execution priority

serverPriority(0) = “USCHDLNA002/US/ABC” 'execute on this server if available

serverPriority(1) = “USCHDLNA003/US/ABC” 'if all above not avail do it here

serverPriority(2) = “USCHDLNA004/US/ABC” 'if all above not avail do it here

serverPriority(3) = “USCHDLNA005/US/ABC” 'if all above not avail do it here

pathfilename = “names.nsf” 'default database to look for soe know the server is up

'begin of routine

Set s = New NotesSession

Set db = s.CurrentDatabase

Set agent = s.CurrentAgent

If thisserver = “” Then

thisserver = agent.ServerName

End If

If thisserver = “” Then

thisserver = “USCHDLNA004/US/ABC” 'forcing a servername so can test this agent

End If

i = Ubound(serverPriority)

x = 0

Dohile x < (i + 1)

if serverPriority(x) = thisserver Then

Exit Do’ e execute this agent, exiting Loop

End If

Set servercheck = s.GetDatabase( serverPriority(x), pathfilename ) ’ if this fails error handling jumps execution to ‘serverdown’

Exit Sub ’ this agent should not execute! exiting now

serverdown:

x = x + 1

Loop

If not serverPriority(x) = thisserver Then 'final confirmation this agent is on an expected server

Exit Sub

End If

'start your code below

Subject: RE: How do scheduled agents work on Cluster Servers

Hi,No native failover support for scheduled agents in Domino

www.ibm.com/support/docview.wss?rs=463&uid=swg21098304

There is a really good article on eview :

Failover Support for Background Agents on Clustered Domino Servers — A Solution for Your Lotus Workflow and Domino Applications

http://drh02.eapps.com/eview/viewr6.nsf/e640f630a3361f84852568f600070fd3/708b2f8f04e509ae85256ba5006a98a9?OpenDocument&Highlight=0,failover,agent

JYR

Subject: RE: How do scheduled agents work on Cluster Servers

Thanks Stan & Jean for your valuable input…Quite helpful…