Forum Discussion

amritkp789's avatar
amritkp789
Icon for Nimbostratus rankNimbostratus
Jun 08, 2020

How to mark a Virtual-Server down if at-least 4 members out of 5 are not up?

My Setup :

4 LTM boxes at 4 DCs.

4 VS for an application.

Each VS under each LTM of the respective DC has it's own set of 5 Equal-Capacity-Servers

  • A DC has servers A1,A2,A3,A4 and A5 inside A_Pool associated to A_VS in LTM A.
  • B DC has servers B1, B2, B3, B4 and B5 inside B_Pool associated to B_VS in LTM B.
  • C DC has servers C1, C2, C3, C4 and C5 inside C_Pool associated to C_VS in LTM C.
  • D DC has servers D1, D2, D3, D4 and D5 inside D_Pool associated to D_VS in LTM D.

All 4 VSs are part of the GTM Pool associated to wideip App_WIP used for "application.domain.com" FQDN.

The GTM Pool has GA Load-Balancing Mode with the following order : A_VS (Ord 0), B_VS (Ord 1), C_VS (Ord 2) and D_VS (Ord 3)

 

Requirement:

If out of 5 Servers in A DC if 2 goes down, A_VS should be marked down, so that GTM do not picks it for next DNS Query, untill a minimum of 4 Servers are UP in the A_Pool. Similarly for 3 VSes too.

 

How Do I achieve this?

 

1 Reply

  • Hi,

    I think you can reach this working on LTM with two pools and an external monitor that will reflect on GTM layer.

    e.g.

    LTM A::

    Virtual Server: A_VS

       Default pool: A_Pool

    Pool: A_Pool

        Members:

          A1

          A2

          A3

          A4

          A5

        Health Monitor: A_Pool_monitor

          

    Pool: A_Pool_health_check

      Members:

        A1

        A2

        A3

        A4

        A5

      Health monitor: tcp (your choice)

    Monitor: A_Pool_monitor

      Type: External

      External program: pool_health_check_script

      Variables:

        MIN_ACTIVE = 4

        POOL_NAME = A_Pool_health_check

    External Monitor Program file: pool_health_check_script

       Definition:

    #!/bin/sh
     
    # These named parameters should be filled on LTM monitor setup
    # POOL_NAME = name of pool to health check
    # MIN_ACTIVE = min member active count to be UP
    # Name of the pidfile
    pidfile="/var/run/$MONITOR_NAME.$1..$2.pid"
     
    # Send signal to the process group to kill our former self and any children 
    # as external monitors are run with SIGHUP blocked
    if [ -f $pidfile ]
    then
       kill -9 -`cat $pidfile` > /dev/null 2>&1
    fi
     
    echo "$$" > $pidfile
     
    count=$(tmsh show ltm pool $POOL_NAME field-fmt |grep active-member-cnt |awk '{print $2}')
     
    if [[ $count -ge $MIN_ACTIVE ]]
    then
    # Remove the pidfile before the script echoes anything to stdout and is killed by bigd
        rm -f $pidfile
        echo "up"
    fi
    rm -f $pidfile

    Repeat this structure for all other LTMs.

    There is no need for changes to the GTM.

    So, when the pool for real health check members fails on min requirement, the monitor will mark down the default pool members and virtual server goes unavailable as well.

    Makes sense?

    It's the best I can do now.

    Regards.