Reputation: 3514
Pardon my zero knowledge on F5 and it's implementation. We have 4 web servers on which we want to use F5 to distribute the load. We are replacing Apache Camel software load balancer.
Current Implementation:
Every client creates a session ID when customer initiate interaction and send SOAP request to SW LB URL. http://Server1:7001/WebService
SW load balancer is using round robin algorithm to find the suitable server from following 4 destinations and creates a map of Server end point and session ID. http://Server1:9080/WebService http://Server2:9080/WebService http://Server3:9080/WebService http://Server4:9080/WebService
SW LB maintains this session for 10 minutes. Within this time if request again comes for the same session ID, same destination server is used to process the request. So in this way, if user has session with Server2 - this server will keep serving him until user end the session (or session timeout).
As it can be seen on Server1 we have load balancer + web service. We are decomissinong SW load balancer to migerate on F5.
Above scheme can be implemented on F5? And will F5 will give us a new URL? Which we will share with our clients to receive requests? Like http://[new_IP_HW_LB]:[new_port]/WebService
Will it be able to extract Session ID from the incoming request and can maintain sticky session map?
Upvotes: 0
Views: 234
Reputation: 1433
Yes, you can replace Apache Camel with F5, and your setup is pretty standard. Create 4 nodes, a pool with 4 members, and the Virtual Server.
The F5 will need a new IP address [URL], unless Server1 gives up the address. You can also use a standard port (80 for HTTP, 443 for HTTPS).
The hardest part is the Session ID persistence. You'll need to create a Universal Persistence profile (Local Traffic » Profiles » Persistence) with a 600 second timeout and create an iRule to create the record based on the XML format. iRules can be tricky, but the DevCentral community already has a solution you can adapt.
Credit to Stanislas from DevCentral: how get response parameters. This iRule will capture the parameter within the <uid>
XML tag.
when HTTP_RESPONSE {
# Trigger collection for up to 1MB of data
if {[HTTP::header exists "Content-Length"] && [HTTP::header "Content-Length"] <= 1048576}{
set content_length [HTTP::header "Content-Length"]
} else {
set content_length 1048576
}
# Check if $content_length is not set to 0
if { ([HTTP::status] == 200) && ($content_length > 0)} {
HTTP::collect $content_length
}
}
when HTTP_RESPONSE_DATA {
# do stuff with the payload
#find the application unique identifier between <uid> and </uid> (5 is the length of <uid> string)
persist add uie [string trim [findstr [HTTP::payload] "<uid>" 5 "</uid>"]]
}
when HTTP_REQUEST {
persist uie [string trim [findstr [HTTP::payload] "<uid>" 5 "</uid>"]]
}
Upvotes: 2