Forum Discussion

ERLomboy_27803's avatar
ERLomboy_27803
Icon for Nimbostratus rankNimbostratus
Nov 06, 2014

Help with custom LB method

Hi F5 peers,

 

Need some help on how to approach a requirement from our DB team.

 

Customized LB which distributes traffic to pool_member 1 and pool-member2. If and when pool_member2 is unavailable traffic should go to pool_member1. But if pool_member1 is unavailable it SHOULD NOT go to pool_member2.

 

Thanks in advance!!

 

12 Replies

  • Hi,

    when HTTP_REQUEST { 
        if { [active_members [pool_1] ] > 0 } { 
            if { !([lsearch -exact [active_members -list pool_1] pool_member1:its_port]) } {
                reject
            }
        }
    }
    
    • ERLomboy_27803's avatar
      ERLomboy_27803
      Icon for Nimbostratus rankNimbostratus
      Hi Thomas, Thank you for sharing.. So it's only possible via iRule as you were suggesting?
  • Hi,

    when HTTP_REQUEST { 
        if { [active_members [pool_1] ] > 0 } { 
            if { !([lsearch -exact [active_members -list pool_1] pool_member1:its_port]) } {
                reject
            }
        }
    }
    
    • ERLomboy_27803's avatar
      ERLomboy_27803
      Icon for Nimbostratus rankNimbostratus
      Hi Thomas, Thank you for sharing.. So it's only possible via iRule as you were suggesting?
  • This iRule will check if member1 is down. If it is, the request will be rejected. Then you also have to define priority group into your pool, with a higher priority for your member_2.

     

  • You could also do member-specific monitors applied to member_2. the first monitor would be the monitor used to check member_2, the second monitor could check the status of member_1 using monitor configuration items alias-address and alias-port settings that specify member_1

     

    • ERLomboy_27803's avatar
      ERLomboy_27803
      Icon for Nimbostratus rankNimbostratus
      Hi Shaggy, Thanks for sharing.. Meaning I don't need to do the iRule, just monitoring? Edward
    • shaggy_121467's avatar
      shaggy_121467
      Icon for Cumulonimbus rankCumulonimbus
      correct. member-specific monitors can be a pain as they are often forgotten when doing config changes or doing troubleshooting since most admins will only notice pool-level monitors
  • shaggy's avatar
    shaggy
    Icon for Nimbostratus rankNimbostratus

    You could also do member-specific monitors applied to member_2. the first monitor would be the monitor used to check member_2, the second monitor could check the status of member_1 using monitor configuration items alias-address and alias-port settings that specify member_1

     

    • ERLomboy_27803's avatar
      ERLomboy_27803
      Icon for Nimbostratus rankNimbostratus
      Hi Shaggy, Thanks for sharing.. Meaning I don't need to do the iRule, just monitoring? Edward
    • shaggy's avatar
      shaggy
      Icon for Nimbostratus rankNimbostratus
      correct. member-specific monitors can be a pain as they are often forgotten when doing config changes or doing troubleshooting since most admins will only notice pool-level monitors