Forum Discussion

Raja_M's avatar
Raja_M
Icon for Nimbostratus rankNimbostratus
May 21, 2018

Load Balence is not happening on pool members with two differnt service ports

Load balance is not happening and the traffic is going to only one pool members 15201.Could you please let me know.and the Lb method is Roundrobin

the url: http://jdeprod1.corp.abc.com

ltm virtual JDEPROD.corp.abc.com_vs { description Replica_of_JDEPROD.corp.abc.com_vs-172.30.23.45 destination 172.30.23.53:http ip-protocol tcp mask 255.255.255.255 persist { cookie { default yes } } pool JDEPROD.corp.abc.com_pool profiles { http { } stream { } tcp_e1_prd_na_web { } } rules { E1_Root_Redirect jdeprod1_irule } source 0.0.0.0/0 source-address-translation { type automap } translate-address enabled translate-port enabled vs-index 106 }

ltm pool JDEPROD.corp.abc.com_pool { description JPEDPROD_Replica_of_JDEPD.corp.abc.com_pool members { POKLXJDNAJASP1:15201 { address 172.30.50.160 session monitor-enabled state up } POKLXJDNAJASP1:15203 { address 172.30.50.160 session monitor-enabled state up } POKLXJDNAJASP2:15201 { address 172.30.50.161 session monitor-enabled state up } POKLXJDNAJASP2:15203 { address 172.30.50.161 session monitor-enabled state up } } monitor JDEMonitor_New }

ltm rule E1_Root_Redirect { when HTTP_REQUEST {

if { ([ string length [HTTP::uri] ] <= 1) } {

HTTP::respond 301 Location /jde/owhtml }

} }

ltm rule jdeprod1_irule { when HTTP_REQUEST { Disable STREAM processing for request (ingress) traffic STREAM::disable

 Remove the Accept-Encoding header to disable server side compression
HTTP::header remove Accept-Encoding

 Replace the incoming Host header to match what the server expects
HTTP::header replace Host "jdeprod1.corp.abc.com:15201"

} when HTTP_RESPONSE { if { [HTTP::header exists Location] } { If this is a redirect response, replace with HTTP::header replace Location [string map {"jdeprod1.corp.abc.com:15201" "jdeprod1.corp.abc.com"} [HTTP::header Location]]

}
 Use a STREAM expression to remap all object references in the payload (HTML body) with the external host name
STREAM::expression {@jdeprod1.corp.abc.com:15201@jdeprod1.corp.abc.com@}
STREAM::enable

} when LB_SELECTED { log local0. "URI [HTTP::uri] Client [IP::client_addr] [LB::server] selected." } }

Note: i tried with adding another port 15203 in Header replace but it dosent work,

  • I wonder if you really need the jdeprod1_irule iRule to make this work. Have you tried without it? Port translation is enabled, so that should do the trick.

     

  • Raja_M's avatar
    Raja_M
    Icon for Nimbostratus rankNimbostratus

    If I remove the jdeprod1_irule the application won't work, and it will got the web server page

     

  • Hi,

     

    How you check that traffic goes only to pool members 15201?

     

    Can you go to you pool (clik on it) then check statistics.

     

    Regards,

     

  • Raja_M's avatar
    Raja_M
    Icon for Nimbostratus rankNimbostratus

    Hi Team, Pleas help me and even i tried with many f5 tac support there is no fix.

    1. The Vip is port 80 and backed services are 15201 and 15203 with 2 servers totally 4 Pool members.
    2. We have 2 irule one is redirect with additional uri /jde/owhtml and other irule is header replace and compression and if i remove this irule its thowing this below error
    3. Even i tried editing the JDEPROD irule as below mentioned but its not working as expected.

    when HTTP_REQUEST { Disable STREAM processing for request (ingress) traffic STREAM::disable

     Remove the Accept-Encoding header to disable server side compression
    HTTP::header remove Accept-Encoding
    
     Replace the incoming Host header to match what the server expects
    HTTP::header replace Host "jdeprod1.corp.abc.com:15201"
    HTTP::header replace Host "jdeprod1.corp.abc.com:15203"
    

    } when HTTP_RESPONSE { if { [HTTP::header exists Location] } { If this is a redirect response, replace with HTTP::header replace Location [string map {"jdeprod1.corp.abc.com:15201" "jdeprod1.corp.abc.com"} [HTTP::header Location]] HTTP::header replace Location [string map {"jdeprod1.corp.abc.com:15203" "jdeprod1.corp.abc.com"} [HTTP::header Location]]

    }
     Use a STREAM expression to remap all object references in the payload (HTML body) with the external host name
    STREAM::expression {@jdeprod1.corp.abc.com:15201@jdeprod1.corp.abc.com@}
    STREAM::expression {@jdeprod1.corp.abc.com:15203@jdeprod1.corp.abc.com@}
    STREAM::enable
    

    }

    error screen shot:1 Connection is going to properly on 15201 is working the second connection when it goes to 15203 its throwing this error.

    • Raja_M's avatar
      Raja_M
      Icon for Nimbostratus rankNimbostratus

      IN My irule i removed the port 15201 and added 15203 as mentioned below.

       

      HTTP::header replace Host "jdeprod1.corp.abc.com:15203"

       

      STREAM::expression {@jdeprod1.corp.abc.com:15203@jdeprod1.corp.abc.com@}

       

      i got the below error.

       

       

    • Raja_M's avatar
      Raja_M
      Icon for Nimbostratus rankNimbostratus

      i tried without inserting port number example as mentioned below it dosent work .and application page is not opening

       

      HTTP::header replace Host "jdeprod1.corp.abc.com"

       

      STREAM::expression {@jdeprod1.corp.abc.com@jdeprod1.corp.abc.com@}

       

  • Surgeon's avatar
    Surgeon
    Ret. Employee

    Based on the connection table all the requests coming from the same src 172.30.3.169 and you have cookie persistence enabled.

     

    This explains why all the requests from the same src go to the same pool member. What is the reason for cookie persistence?