For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

BMARTIN_12200's avatar
BMARTIN_12200
Icon for Nimbostratus rankNimbostratus
Dec 15, 2008

Add 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

  • 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's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    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