08-Jun-2020 05:55
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
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?
11-Jun-2020 11:12
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.