Forum Discussion
skkg_111590
Nov 12, 2010Nimbostratus
need irule help
I need help as I am new to irule
When user tries to go to
1. http://abc.com/secure/* ----------it should redirect to https://abc.com./secure/* --works all fine.
when HTTP...
Thanks 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?