Forum Discussion

piyush_Mahu_727's avatar
piyush_Mahu_727
Icon for Nimbostratus rankNimbostratus
Jun 21, 2007

irule to change pool based on state of another server or pool

We have two load balanced silos for mail based in two separate sites. Each silo consists of (for inbound email) an Internet SMTP server, a VIP that load balances across multiple email scrubbers and then a VIP for Internal mail servers. The problem is that email scrubbers in one site can't handle the load if the Internet SMTP server on one of the silos goes down. One of the solutions (instead of adding more scrubbers) is to create another pool in each site that has scrubbers from both sites in it. The idea is to be able to call this pool in case if either one of the Internet SMTP servers goes down.

 

 

So in short, an irule attached to the scrubber VIP needs to be able to change a pool based on the state of members in another pool. Any suggestions in this regard will be highly appreciated.

 

 

Thank you,

 

 

PM
  • Since iRules are triggered by incoming connections and not changes in a pool member's state, I don't see how this can be done by iRules.

     

     

    -Al
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    Al is correct that changes elsewhere won't affect local iRule decisions, but I think we could take a bit of an outside-the-box approach to solve the problem:

    I suppose you could define at each site a pool (not used for LB) that contains only the remote SMTP server, just for the purpose of monitoring its status. (You wouldn't need to know the status of the local SMTP server, I think, because if it's a silo, no traffic would come through the local scrubber VS from the dead SMTP server, right?)

    You'd keep the existing local scrubber pool as the default pool, and create as you mention another global scrubber pool containing all the scrubbers from both sites.

    Then in an iRule, use the LB::status command to check if the remote SMTP server is down, and choose the appropriate pool accordingly:
    when RULE_INIT {
      set ::RmtSvrIP 192.168.1.1
      set ::RmtSvrPool RemoteSMTPServer
    }
    when CLIENT_ACCEPTED {
      if {([LB::status pool $::RmtSvrPool member $::RmtSvrIP 25] != "down") } {
         pool LocalScrubberPool
      } else {
         pool GlobalScrubberPool
      }
    }
    HTH

    (I'd be interested to know if this works for you.)

    /deb
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    Forgot to mention (in case it didn't jump right out at you) that you'd have to run an SMTP monitor/health check against the remote SMTP server to determine its status.
  • Thank you. I was concerned if this idea would work or not. I am going to try this in my dev environment and respond with results. You are correct that I dont need to know the status of the local SMTP server - only the one on the other site. The same applies for VIP configuration on the other site. I did catch the monitoring requirement as that is key to this approach, thanks for pointing it out though.

     

     

    PM