Forum Discussion
Vincent_96516
Nimbostratus
Apr 17, 2012Message based load balancing connection status
I am creating irules script to work under message based load balancing profile (mblb), the following are some issues I have (OS v.10.2.3):
(1) When there are no active members in the pool (all ba...
Vincent_96516
Nimbostratus
Apr 18, 2012Thanks Nat for the suggestions.
For issue (1), I used the example 1, and the issue is resolved.
For issue (2), the example doesn't help. The main purpose for perioldically sending ping message is to handle node restart or new node join the pool when server side sending request message and waiting for response (I explain my requirement below).
I am implement a high availablity solution for a finanical product.
The communication is message based. One persistent client connection will be handled by multiple backend servers.
The message format we are using is private (2 bytes binary header + binary payload). We will do load balancing based on one field in the message.
The message can be either started from client side (client send request and wait for response) or server side (server send request and wait for response).
The issue (2) I have is for server side sending request and waiting for response. When accepting client connection, I send ping message to each active member, so there will be a connection with every active member, each member can use this connection to send request. But if one member is brought down and restart, there will be no connection between LTM and the newly started member because the client will not send request and pool to the newly started node. So I tried to send ping message perioldically, so if there is new active member, a connection could be created with the member.
I tried to set send ping message perioldically in CLIENT_ACCEPT:
when CLIENT_ACCEPTED {
log local0. "Client [IP::remote_addr]:[TCP::remote_port]-[TCP::local_port]"
if {[active_members [LB::server pool]] < 1} {
reject
return
}
broadcast connect message to backend servers
foreach m [active_members -list [LB::server pool]] {
log local0. "send connect to $m"
after 500
pool [LB::server pool] member [lindex $m 0] [lindex $m 1]
TCP::payload replace 0 0 $static::conn_ping
TCP::release 2
TCP::notify request
}
check every second
after 2000 -periodic {
if { [active_members [LB::server pool]] == 0 } {
reject
log local0. "TCP connection closed to [TCP::local_port]."
}
}
Check whethere there is new member
after 30000 -periodic {
foreach am [active_members -list [LB::server pool]] {
pool [LB::server pool] member [lindex $am 0] [lindex $am 1]
log local0. "send status ping to $am"
TCP::payload replace 0 0 $static::conn_ping
TCP::release 2
TCP::notify request
}
}
TCP::collect
}
but I got error:
Apr 18 12:52:01 local/tmm2 err tmm2[5551]: 01220001:3: TCL error: CAM-MBLB - Address in use (line 2) invoked from within "pool [LB::server pool] member [lindex $am 0] [lindex $am 1]" ("foreach" body line 2) invoked from within "foreach am [active_members -list [LB::server pool]] { pool [LB::server pool] member [lindex $am 0] [lindex $am 1] log local0. ..."
Is there any way to solve this kind of issue?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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