Forum Discussion

Sheila_Liu_8576's avatar
Sheila_Liu_8576
Icon for Nimbostratus rankNimbostratus
Aug 18, 2006

How to add delay when activating a pool member

trying to write an irule for a pool with two pool members, both members runs database but one is active, the other is inactive.

 

when the active one goes down, would need to wait 5-10 minutes to bring up the inactive member.

 

 

Is there a timer/delay function in irule to do this?

 

 

Thanks.

 

 

2 Replies

  • The best place for a requirement like that is in iControl. A possible iRule solution could be handled by measuring the time of failure on server one, then checking to make sure 5 minutes has passed, then up server two and reset the failure variable back to 0. You need to be on a 9.2 version, and someone else might post back on a better event to place the checking other than CLIENT_DATA. I usually only use the HTTP events, so I'm unclear what's best for not HTTP traffic.

    
    when CLIENT_CONNECTED {
      set failure 0
      set time_failed 0
    }
    when CLIENT_DATA {
      if { $failure } {
        if { [clock seconds] > [expr { $time_failed + 300 }] } {
           LB::up pool yourPool member 2ndServer yourPort
           set failure 0
        }
      }
    }
    when LB_FAILED {
      set failure 1
      LB::down pool yourPool member [LB::server addr] yourPort
      set time_failed [clock seconds]
    }

    This is untested! It might not work, but maybe it will get the wheels turning for you...