Forum Discussion
BMARTIN_12200
Nimbostratus
Dec 15, 2008Add Ip member pool in my header browser
Hello, my application is spread over 24 servers JBOSS cluster of 6 pools of 4 members. To facilitate maintenance I would like to appear in the title of the browser the IP address of the member on which it is connected.
I read a lot on the forum but I need a concrete example based on my Irule below. Thank you
Can you help me ?
=================================================
when HTTP_REQUEST timing on {
set electedpool [HTTP::cookie "persist"]
if {"" ne $electedpool} {
if { [active_members HOM_JBOSS_VIP1_POOL_$electedpool] >= 1 } {
pool HOM_JBOSS_VIP1_POOL_$electedpool
} else {
set P [expr ($electedpool+1) %2]
set electedpool ""
pool HOM_JBOSS_VIP1_POOL_$P
}
} else {
set P [expr (int(rand()*1000000))%2]
if { [active_members HOM_JBOSS_VIP1_POOL_$P] >= 1 } {
pool HOM_JBOSS_VIP1_POOL_$P
} else {
set P [expr ($P+1) %2]
pool HOM_JBOSS_VIP1_POOL_$P
}
}
}
when HTTP_RESPONSE timing on {
if {"" eq $electedpool} {
HTTP::cookie remove persist
HTTP::cookie insert name persist value "$P" path /
}
}
22 Replies
- BMARTIN_12200
Nimbostratus
I found the reason for the failure of the rule STREAM: expression.
I have two members in my pool test when both are active, it dysfunctional.
If I remove a member, it works.
Have you any idea?when HTTP_RESPONSE { Need to explicitly disable the stream profile by default so it doesn't stay enabled for subsequent HTTP requests on the same TCP connection. STREAM::disable Apply stream profile against text responses from the application if { [HTTP::header value Content-Type] contains "text" }{ switch [IP::server_addr] { "10.x.x.156" { set nvip "mnr04 nvir0156" } "10.x.x.157" { set nvip "mnr04 nvir0157" } default { set nvip [IP::server_addr]} } Replace with 1.1.1.1 where 1.1.1.1 is the server IP adddress STREAM::expression "@<\[Tt\]\[Ii\]\[Tt\]\[Ll\]\[Ee\]>@$nvip - @" Enable the stream profile STREAM::enable } } - hoolio
Cirrostratus
That's very odd. I'm not sure what would cause the error. I'd suggest opening a case with F5's support group about this.
Here are a few questions I'd be curious about:
With no changes to the iRule, if you disable all but one member in the pool, you never see the error? But as soon as you add a second member you see the error? With multiple pool members, does the error occur on every single response that the stream filter is enabled on?
Aaron
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
