Forum Discussion

nacejj_65488's avatar
nacejj_65488
Icon for Nimbostratus rankNimbostratus
Oct 19, 2011

Header Rewrite & Port Translation Issues (Oracle App Servers)

I am currently load balancing a 10.2.1 LTM to two legacy Oracle applications (Tru64 Alpha Server) The applications need to be accessed on port 8895. Everything in my config is on the same subnet besides our mgt port. I am trying to access the application via http://VS_Domain:8895/oracle/directory.

 

 

I know its load balancing correctly because I am able to access http://VS_domain and the apache web server page pops up. I am also able to access each node individually through the network through the F5 and completely access the application (F5 acting as a switch instead of load balancing)http://Node_domain:8895/oracle/directory.

 

 

The Oracle App Servers don't seem to answer to IP addresses so I implemented this iRule and the corresponding data strings. http://devcentral.f5.com/wiki/iRules.rewrite_host_header_to_server_name.ashx

 

ipaddress := http://Node_Domain:8895/Oracle/Directory. I thought this would also solve the port issues because its right there in the new rewritten header pulled from the data string. (40 executions no failures).

 

 

Like I said the application is fully functional when just trying to access one of the nodes hostnames but it is using the F5 as a switch instead of load balancing.

 

 

 

PS. The IP address of our virtual server is added to our DNS records, the VS is set to all ports, and the pool is set to all ports.

 

 

 

Let me know if you have any ideas.

 

19 Replies

  • if nothing can be found, i recommend opening a support case. so, support engineer can help you to look into tcpdump file.

     

     

    cheer!
  • In this line:

     

     

    set host_header_value [findclass [LB::server addr] ip_to_host_class " "]

     

     

    Does the ip_to_host_class specify the port as well as the fqdn? Some apps require the port specified if non-default. Like:

     

     

    www.mydomain.com:8895

     

     

    instead of just www.mydomain.com

     

     

  • the ip_to_host _class data string does define the port and directory.

     

    i.e.

     

     

    10.10.10.10:=http://Node_Hostname1:8895/oracle/directory

     

    10.10.10.11:=http://Node_Hostname2:8895/oracle/directory

     

     

     

    but judging from the log files in /var/log/ltm it is returning a period and not the designated strings above.

     

     

    (I also switched them around http://....:=10.10.10.10 and that didn't help)
  • findclass is just one of the command depreciated from the iRule posted above. There has to be some sort of compatibility issue with the tested 9x version and my 10.2.1. I'm guessing this is my issue because the iRule isn't returning my string value in the datagroup I have called.
  • Hi nacejj,

    Here is a simple example of value retrieval from a Data Group if it helps. I used "class match" instead of "findclass".

    
    Data Group:
    
    class redirect_datagroup {
       {
          "/bar" { "http://www.msn.com" }
          "/foo" { "http://www.google.com" }
          "/foobar" { "http://www.yahoo.com" }
       }
    }
    
    iRule:
    
    when HTTP_REQUEST {
    if { [class match [string tolower [HTTP::uri]] contains redirect_datagroup] } {
    HTTP::redirect [class match -value [HTTP::uri] equals redirect_datagroup]
    }
    }
    

    Hope this helps.
  • by the way, does host header include method (e.g. http://) and path (e.g. /oracle/directory)? isn't it like Node_Hostname1:8895 or Node_Hostname2:8895?
  • You are mixing up the terms. Method is GET, POST , etc

     

     

    A URL is made up

     

    Of protocol ( http or https), the host and optional port, and the URI ( or path)

     

     

     

    Host header has the host and optionally port

     

     

     

    Tom Schaefer

     

  • You are mixing up the terms.

     

     

    Method is GET, POST , etc

     

     

    A URL is made up Of protocol ( http or https), the host and optional port, and the URI ( or path)

     

     

    Host header has the host and optionally portoh yes, thanks for correcting. i was blur. -/\-
  • I want my data group to return the whole URI (http://Node_Hostname1:8895/oracle/Directory.html or http://Node_Hostname2:8895/oracle/Directory.html) since that is where the application resides. Therefore, that will be my string returned when the data value (Node_IPaddress1 or Node_IPaddress2) are present.

     

     

    Michael - Does that iRule effectly load balance the redirects? We give out the link to our virtual server URI when then resolves to the VS IP. Then that iRule should kick into gear and pull the Node_URI's listed above. It cant try and resolve the Node_Hostnames to IP's because our application server only answers to hostnames. (Which is why this has gotten so complicated).