Forum Discussion

smalte_85868's avatar
smalte_85868
Icon for Nimbostratus rankNimbostratus
Mar 10, 2009

Help

I have JDedwards installed on 2 servers under Oracle application server.

 

I have created a virtual server that point to pool of IP addresses pointing to these 2 servers.

 

 

My virtual address is http://erpdev.abc.com

 

annd my 2 servers jde url is http://server1.abc.com/jde/E1Menu.maf and http://server2.abc.com/jde/E1Menu.maf.

 

 

First I want to make sure that the user load is balanced between these 2 servers and also when a user logs into http://erpdev.abc.com it should reslove to one of these servers but keep the server name hidden for eg it should navigate through jde as http://erpdev.abc.com/jde/E1Menu.maf, so its trasparent to the user what jde webserver he is connected to.

 

 

Any help in genrating a irule to accomplish this would be highly appreciated.

 

 

VIP

 

 

erpdev.ddr.com

 

Address : 192.168.7.224 Port 80

 

Default Pool: erpdev

 

 

Pool Members

 

 

1. 192.168.7.236:80 points to bwjasp5.ddrc.ads

 

2. 192.168.7.237:80 points to bwjasp5.ddrc.ads

 

3. 192.168.7.238:80 points to bwerpwebd2.ddrc.ads

 

4. 192.168.7.239:80 points to bwerpwebd2.ddrc.ads

 

 

Irule: (Manual LB , kinda forcing it to work)

 

 

BEGIN

 

when RULE_INIT {

 

set ::lb_counter 1

 

log local0. "Rule Starting lb_counter is $::lb_counter"

 

}

 

when HTTP_REQUEST {

 

log local0. "HTTP Request counter is $::lb_counter"

 

if { $::lb_counter == 1 } {

 

log "Logging to server1"

 

HTTP::redirect http://bwjasp5.ddrc.ads/jde/owhtml

 

HTTP::header replace Location [string map {bwjasp5.ddrc.ads erpdev.ddr.com} [HTTP::header Location]]

 

set ::lb_counter 2

 

return

 

} elseif { $::lb_counter == 2 } {

 

log local0. "Logging to server2"

 

HTTP::redirect http://bwerpwebd2.ddrc.ads/jde/owhtml

 

HTTP::header replace Location [string map {bwerpwebd2.ddrc.ads erpdev.ddr.com} [HTTP::header Location]]

 

set ::lb_counter 1

 

}

 

}

 

END

 

 

  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Hi,

     

     

    You can use LB::select (Click here) to force a load balancing decision in HTTP_REQUEST. This will provide more functionality than a manual round robin selection in your iRule.

     

     

    Do you want to redirect the client directly to the server though? The client would see the update to the domain name in the address bar and they would not be load balanced for any subsequent requests. Or do you want to rewrite the host header in the request to the server's host header? Will the individual servers only answer if the host header is set correctly?

     

     

    If you do want to avoid a redirect, you can rewrite the host header using 'HTTP::header replace Host "newhost.example.com". If you need to rewrite the redirects, you can do this in the HTTP_RESPONSE event. You can check if the response is a redirect using HTTP::is_redirect (Click here).

     

     

    Aaron