Forum Discussion
Khamari_2736
Nov 28, 2011Nimbostratus
Global load balance between two servers (failover), with no preemption
Hello Group,
We would like to global load balance between two servers (failover), with no preemption. Meaning that the WideIP will resolve always to the same server until that server in q...
Khamari_2736
Dec 06, 2011Nimbostratus
(honestly it was frustrating to not have this feature on the GTMS, and have to reinvent the wheel, for something as simple as enabling/disabling preemption on the pool members)
Anyway if you are ruining into the same issue this is what I did:
I end up building an auto resume script,that runs on all of the GTMs on a round robin every minute (on the cron job) or so for redenedancy.
The script uses snmpwalk to check the pools status on the localhost, and uses the GTM native tmsh command to bring only the pools that are completely down (on manual resume status) up.
Here it is:
!/usr/bin/perl
================================================================
$Id:$
$Revision:$ v1.0.0
$Author:$ Ahmed Khamari
$Date:$ 12-06-2011
================================================================
Description: Enable pool members that are manually disabled when their pool
is completely down, due to a manual resume feature.
Combining this with global availability, to Globally failover between two servers will
prevent possible flapping issues, if one of the servers goes unstable.
================================================================
Disclaimer:
This script is provided "AS IS", for non-commercial use, and you, its user, assume all risks when using it.
================================================================
my $snmpwalk_prog = '/usr/bin/snmpwalk';
my $snmpwalk_cmd =
$snmpwalk_prog . ' -v2c -c public localhost gtmPoolStatusAvailState';
verify SNMP walk is available
die "Program $snmpwalk_prog is not available" unless -x $snmpwalk_prog;
open( SNMPWALK, '-|', $snmpwalk_cmd )
or die "Failed to run command $snmpwalk_cmd : $!";
while () {
skip green
next if /INTEGER: green/;
get pool
my ($pool) = /"(.*?)"/;
construct command
my $cmd = "tmsh modify gtm pool $pool members modify { all { enabled }}";
run command
print "Running command: $cmd\n";
system($cmd) == 0 or die "$cmd failed";
}
exit(0);
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects